Stacks of SAX: Remembering Tag Relationships in SAX

If you wanted to be masochistic, you could write your own XML parser, reading each character and extracting the elements, text, and attributes from the input stream. Your program would have to know every detail about the syntax of XML. You would have to take into account things such as escaping characters, parsing elements and attributes, and making entity substitutions. But you don't need to do any of this, because there are many free (and good) XML parsers available for Java.

SAX is one type of XML parsing. With a SAX-based parser, you write an event listener class that receives ...

Get Wicked Cool Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.