Summary
Reading an XML document is a complicated, error-prone operation, which is why it's fortunate that you never have to write the code that does this. Instead you install an XML parser class library and only access the document through the parser's API. Numerous XML parsers for Java are available as free beer, open source, and payware, including the Apache XML Project's Xerces, Sun's Crimson, Enhydra's kXML, the GNU Classpath Extensions Project's Ælfred, and Yuval Oren's Piccolo. Most XML parsers implement one or more of the standard APIs such as SAX, DOM, and XMLPULL. As long as you only write code to the standard APIs, you can change the underlying parser with relatively little effort.
Which API you pick is largely a matter of personal ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access