O'Reilly logo

Special Edition Using XML, Second Edition by - et al. David Gulbransen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Document Based Parsing with DOM Under Java

Although event based parsing with the Simple API for XML is fast and memory efficient, it does not provide any context for where the current element is in the hierarchy of the document. This is due to the fact that parsing via SAX is effectively a one-shot operation: The parser only knows about the current element at the moment when it notifies the event handler and then promptly forgets about it.

For applications in which it is useful to have the parser remember more of this contextual information, using a parser that implements DOM is appropriate. DOM has the advantage of storing a complete copy of the XML document in memory at all times, allowing programmers to traverse through the hierarchy of elements ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required