Summary

The Xerces parser offers a way to easily read and write XML data from Java. You have your choice of two different methods of parsing: You can use SAX, which is an event-driven parser that uses callbacks to event handlers that you provide, or you can use DOM, which loads the entire XML document into an object-oriented tree of nodes that your code can walk to discover content.

You can also use DOM to create a brand-new hierarchy and then generate XML output based on it. This has the advantage of always generating syntactically correct XML.

More packages are being written each day to use XML in some way. In fact, it is nearly impossible to develop a major application anymore without needing to read or write XML. As a result, learning to ...

Get MySQL™ and JSP™ Web Applications: Data-Driven Programming Using Tomcat and MySQL 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.