java.lang.Object
javax.xml.parsers.DocumentBuilder
io.sf.carte.doc.dom.XMLDocumentBuilder
Generic
DocumentBuilder for XML documents.-
Constructor Summary
ConstructorsConstructorDescriptionXMLDocumentBuilder(DOMImplementation domImpl) XMLDocumentBuilder(DOMImplementation domImpl, SAXParserFactory parserFactory) -
Method Summary
Modifier and TypeMethodDescriptionGet theSAXParserFactoryobject used by this builder.Get theXMLReaderto be used when parsing.booleanbooleanbooleanbooleanparse(InputSource is) voidreset()voidvoidvoidsetHTMLProcessing(boolean html) Configure the builder to process the document as XHTML.voidsetIgnoreElementContentWhitespace(boolean ignore) Configure the builder to ignore (or not) element content whitespace when building the document.voidsetIgnoreNotSpecifiedAttributes(boolean ignore) Configure the builder to ignore (or not) the attributes that were notspecified, when building the document.voidsetStrictErrorChecking(boolean strictErrorChecking) Set thestrictErrorCheckingflag on the documents created by the DOM implementation.voidsetXMLReader(XMLReader xmlReader) Set theXMLReaderto be used when parsing.Methods inherited from class javax.xml.parsers.DocumentBuilder
parse, parse, parse, parse
-
Constructor Details
-
XMLDocumentBuilder
-
XMLDocumentBuilder
-
-
Method Details
-
parse
- Specified by:
parsein classDocumentBuilder- Throws:
SAXExceptionIOException
-
isNamespaceAware
public boolean isNamespaceAware()- Specified by:
isNamespaceAwarein classDocumentBuilder
-
isValidating
public boolean isValidating()- Specified by:
isValidatingin classDocumentBuilder
-
isXIncludeAware
public boolean isXIncludeAware()- Overrides:
isXIncludeAwarein classDocumentBuilder
-
setEntityResolver
- Specified by:
setEntityResolverin classDocumentBuilder
-
setErrorHandler
- Specified by:
setErrorHandlerin classDocumentBuilder
-
newDocument
- Specified by:
newDocumentin classDocumentBuilder
-
getDOMImplementation
- Specified by:
getDOMImplementationin classDocumentBuilder
-
getSAXParserFactory
Get theSAXParserFactoryobject used by this builder.- Returns:
- the
SAXParserFactoryobject.
-
getSchema
- Overrides:
getSchemain classDocumentBuilder
-
setHTMLProcessing
public void setHTMLProcessing(boolean html) Configure the builder to process the document as XHTML.Default is
false.- Parameters:
html- set it totrueto process the document as HTML.
-
setIgnoreElementContentWhitespace
public void setIgnoreElementContentWhitespace(boolean ignore) Configure the builder to ignore (or not) element content whitespace when building the document.Default is
false.- Parameters:
ignore- set it totrueto ignore element content whitespace.
-
setIgnoreNotSpecifiedAttributes
public void setIgnoreNotSpecifiedAttributes(boolean ignore) Configure the builder to ignore (or not) the attributes that were notspecified, when building the document.Default is
true.- Parameters:
ignore- set it tofalseto set attributes that have a default value but were not specified.
-
isStrictErrorChecking
public boolean isStrictErrorChecking()- Returns:
- the value of the
strictErrorCheckingflag.
-
setStrictErrorChecking
public void setStrictErrorChecking(boolean strictErrorChecking) Set thestrictErrorCheckingflag on the documents created by the DOM implementation.Default value is obtained from the DOM implementation if possible,
falseotherwise.- Parameters:
strictErrorChecking- the value of thestrictErrorCheckingflag.
-
setXMLReader
Set theXMLReaderto be used when parsing.If no
XMLReaderis set, one will be created by theSAXParserFactory.- Parameters:
xmlReader- the XMLReader.
-
getXMLReader
Get theXMLReaderto be used when parsing.- Returns:
- the XML reader, or
nullif none was set and a default reader shall be created.
-
reset
public void reset()- Overrides:
resetin classDocumentBuilder
-