posted 19 years ago
An alternative (but slightly more complex) solution...
If you're reading actual XML, it's quite easy to create a SAX parser for this. The basic gist would be "ignore all events except for CDATA events". Then, do what you want with the CDATA. The catches:
You have to learn SAX, which is pretty simple but still takes time. It won't work with HTML that isn't XML-compliant. XML parsers are uber-strict, of course.
I did this once but I've lost the source, or I'd help ya out. As Jared says, a regexp solution will be easier - ignore everything between < and > the choice is yours!
--Tim