14.1. Using DOM
We'll leverage the code from Chapter 9 that represents the standings as an XML document. Because that example code produced a single document for the entire standings, our main task is to navigate our way through the XML document until we find the specific division requested, and return just that fragment of the document in a SOAP message.
Because there are multiple ways of processing XML documents (DOM, SAX, JDOM), we need a common format that can be understood by all of the software, or they will never be able to interoperate. The javax.xml.tranform package provides this capability with the Source interface. Each XML API set has a class that implements this interface—DOMSource, SAXSource, and JDOMSource. There is also a StreamSource ...
Get J2EE™ and JAX™: Developing Web Applications and Web Services 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.