Thereafter, JAXP has evolved to an extent, where now it supports a lot more things (like validation against schema while parsing, validation against preparsed schema, evaluating XPath expressions, etc.,) than only parsing an XML document.So, JAXP is a lightweight API to process XML documents by being agnostic of the underlying XML processor, which are pluggable.(Example from openjdk-6-src-b31-15_apr_2014) Another one is the oracle xmlparserv2 from Oracle XDK Some sample test to prove this (you need the oracle xmlparserv2 jar and you also need a META-INF/services/parsers.
It would depend on whether you wanted to feed your XML parser with a single document or multiple. If on the other hand I expect to be dealing with pretty lengthy data or if the response entity could contain an indeterminate number of concatenated XML documents, I would then instead think about wrapping the obtained that performs (a) stripping away of the declarations and (b) insertion of new root elements.
In fact, Tr AX relies upon a SAX2- and DOM-level-2-compliant XML parser/XSLT engine.
JAXP 1.0 allows the developer to change XML parsers by setting a property, and Tr AX provides the same functionality for XSLT engines.
SAXParser Validating(boolean validating) method specifies that the parser produced by this code will validate documents as they are parsed.
SAXParser Validating() method validating − true if the parser produced by this code will validate documents as they are parsed; false otherwise. NA The following example shows the usage of parsers.