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 ...
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