public class DocumentBuilderImpl
extends javax.xml.parsers.DocumentBuilder
Constructor | Description |
---|---|
DocumentBuilderImpl() |
Modifier and Type | Method | Description |
---|---|---|
Configuration |
getConfiguration() |
Get the Saxon Configuration to be used by the document builder.
|
org.w3c.dom.DOMImplementation |
getDOMImplementation() |
Obtain an instance of a
DOMImplementation object. |
boolean |
isNamespaceAware() |
Indicates whether or not this document builder is configured to
understand namespaces.
|
boolean |
isValidating() |
Indicates whether or not this document builder is configured to
validate XML documents against a DTD.
|
org.w3c.dom.Document |
newDocument() |
Create a new Document Node.
|
org.w3c.dom.Document |
parse(org.xml.sax.InputSource in) |
Parse the content of the given input source as an XML document
and return a new DOM
Document object. |
void |
setConfiguration(Configuration config) |
Set the Saxon Configuration to be used by the document builder.
|
void |
setEntityResolver(org.xml.sax.EntityResolver er) |
Specify the
EntityResolver to be used to resolve
entities present in the XML document to be parsed. |
void |
setErrorHandler(org.xml.sax.ErrorHandler eh) |
Specify the
ErrorHandler to be used by the parser. |
public void setConfiguration(Configuration config)
parse(org.xml.sax.InputSource)
method,
and subsequent calls reuse the same Configuration.public Configuration getConfiguration()
setConfiguration(net.sf.saxon.Configuration)
,
or the Configuration created automatically by Saxon on the first call to the
parse(org.xml.sax.InputSource)
method, or null if no Configuration has been supplied and
the parse(org.xml.sax.InputSource)
method has not been called.public boolean isNamespaceAware()
isNamespaceAware
in class javax.xml.parsers.DocumentBuilder
public boolean isValidating()
isValidating
in class javax.xml.parsers.DocumentBuilder
public org.w3c.dom.Document newDocument()
newDocument
in class javax.xml.parsers.DocumentBuilder
public org.w3c.dom.Document parse(org.xml.sax.InputSource in) throws org.xml.sax.SAXException
Document
object.
Note: for this document to be usable as part of a Saxon query or transformation,
the document should be built within the Configuration
in which that query
or transformation is running. This can be achieved using the non-JAXP
setConfiguration(net.sf.saxon.Configuration)
method.
parse
in class javax.xml.parsers.DocumentBuilder
in
- InputSource containing the content to be parsed. Note that if
an EntityResolver or ErrorHandler has been supplied, then the XMLReader contained
in this InputSource will be modified to register this EntityResolver or ErrorHandler,
replacing any that was previously registered.org.xml.sax.SAXException
- If any parse errors occur.public void setEntityResolver(org.xml.sax.EntityResolver er)
EntityResolver
to be used to resolve
entities present in the XML document to be parsed. Setting
this to null
will result in the underlying
implementation using the EntityResolver registered with the
XMLReader contained in the InputSource.setEntityResolver
in class javax.xml.parsers.DocumentBuilder
er
- The EntityResolver
to be used to resolve entities
present in the XML document to be parsed.public void setErrorHandler(org.xml.sax.ErrorHandler eh)
ErrorHandler
to be used by the parser.
Setting this to null
will result in the underlying
implementation using using the ErrorHandler registered with the
XMLReader contained in the InputSource.setErrorHandler
in class javax.xml.parsers.DocumentBuilder
eh
- The ErrorHandler
to be used by the parser.public org.w3c.dom.DOMImplementation getDOMImplementation()
DOMImplementation
object.getDOMImplementation
in class javax.xml.parsers.DocumentBuilder
DOMImplementation
.