Load an XML document, to create a tree representation of the document in memory.
@param source A JAXP Source object identifying the source of the document. This can always bea {@link javax.xml.transform.stream.StreamSource} or a {@link javax.xml.transform.sax.SAXSource}. Some kinds of Source are consumed by this method, and should only be used once.
If a SAXSource is supplied, the XMLReader held within the SAXSource may be modified (by setting features and properties) to reflect the options selected on this DocumentBuilder.
An instance of {@link javax.xml.transform.dom.DOMSource} is accepted provided that the Saxon supportcode for DOM (in saxon9-dom.jar) is on the classpath.
If the source is an instance of {@link net.sf.saxon.om.NodeInfo} then the subtree rooted at this nodewill be copied (applying schema validation if requested) to create a new tree.
Saxon also accepts an instance of {@link javax.xml.transform.stax.StAXSource} or{@link net.sf.saxon.pull.PullSource}, which can be used to supply a document that is to be parsed using a StAX parser.
(9.2) This method no longer accepts an instance of {@link net.sf.saxon.AugmentedSource}, because of confusion over interactions between the properties of the AugmentedSource and the properties of this DocumentBuilder.
@return An
XdmNode
. This will bethe document node at the root of the tree of the resulting in-memory document.
@throws IllegalArgumentException if the kind of source is not recognized