java.lang.Object
javax.xml.parsers.DocumentBuilder
io.sf.carte.doc.dom.XMLDocumentBuilder
Generic
DocumentBuilder
for XML documents.-
Constructor Summary
ConstructorDescriptionXMLDocumentBuilder
(DOMImplementation domImpl) XMLDocumentBuilder
(DOMImplementation domImpl, SAXParserFactory parserFactory) -
Method Summary
Modifier and TypeMethodDescriptionGet theSAXParserFactory
object used by this builder.boolean
boolean
boolean
parse
(InputSource is) void
reset()
void
void
void
setHTMLProcessing
(boolean html) Configure the builder to process the document as XHTML.void
setIgnoreElementContentWhitespace
(boolean ignore) Configure the builder to ignore (or not) element content whitespace when building the document.void
setIgnoreNotSpecifiedAttributes
(boolean ignore) Configure the builder to ignore (or not) the attributes that were notspecified
, when building the document.void
setStrictErrorChecking
(boolean strictErrorChecking) Set thestrictErrorChecking
flag on the documents created by the DOM implementation.void
setXMLReader
(XMLReader xmlReader) Set theXMLReader
to 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:
parse
in classDocumentBuilder
- Throws:
SAXException
IOException
-
isNamespaceAware
public boolean isNamespaceAware()- Specified by:
isNamespaceAware
in classDocumentBuilder
-
isValidating
public boolean isValidating()- Specified by:
isValidating
in classDocumentBuilder
-
isXIncludeAware
public boolean isXIncludeAware()- Overrides:
isXIncludeAware
in classDocumentBuilder
-
setEntityResolver
- Specified by:
setEntityResolver
in classDocumentBuilder
-
setErrorHandler
- Specified by:
setErrorHandler
in classDocumentBuilder
-
newDocument
- Specified by:
newDocument
in classDocumentBuilder
-
getDOMImplementation
- Specified by:
getDOMImplementation
in classDocumentBuilder
-
getSAXParserFactory
Get theSAXParserFactory
object used by this builder.- Returns:
- the
SAXParserFactory
object.
-
getSchema
- Overrides:
getSchema
in classDocumentBuilder
-
setHTMLProcessing
public void setHTMLProcessing(boolean html) Configure the builder to process the document as XHTML.Default is
false
.- Parameters:
html
- set it totrue
to 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 totrue
to 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 tofalse
to set attributes that have a default value but were not specified.
-
setStrictErrorChecking
public void setStrictErrorChecking(boolean strictErrorChecking) Set thestrictErrorChecking
flag on the documents created by the DOM implementation.Default value is obtained from the DOM implementation if possible,
false
otherwise.- Parameters:
strictErrorChecking
- the value of thestrictErrorChecking
flag.
-
setXMLReader
Set theXMLReader
to be used when parsing.If no
XMLReader
is set, one will be created by theSAXParserFactory
.- Parameters:
xmlReader
- the XMLReader.
-
reset
public void reset()- Overrides:
reset
in classDocumentBuilder
-