If you have created a DOM document builder or a SAX parser using the JAXP interfaces, the following instructions tell you how to set features on document builders and SAX parsers created from the JAXP interfaces.
The DocumentBuilderFactory interface contains a
setFeature(String,boolean)
method which
can be used to set features on the underlying parser.
For example:
The SAXParserFactory interface contains a
setFeature(String,boolean)
method which can be used
to set features on the underlying implementation of XMLReader
.
Once you create the SAXParser you can retrieve the underlying
XMLReader
allowing you to set and query features on it directly.
For example:
true
is undetermined! Therefore use
this feature with extreme caution because the parser may get stuck
in an infinite loop or worse.
LSParser
implementation the default value of
this feature is false.
EntityReference
nodes in the DOM tree. The
EntityReference
nodes and their child nodes will be
read-only.
EntityReference
nodes in the DOM tree.
No EntityReference
nodes will be created, only the
nodes corresponding to their fully expanded substitution text will
be created.
EntityReference
nodes in the DOM tree. The document will always contain the entity
reference child nodes.
Text#isElementContentWhitespace():boolean
method.
This feature is relevant only when the grammar is DTD.
java.lang.String#intern(String):String
method.
String#intern()
method. This feature
can only be set to true.
notationDecl
and unparsedEntityDecl
events to
be sent in the XNI pipeline after the endDTD
event has been sent.
notationDecl
and unparsedEntityDecl
events
are not sent after the endDTD
event has been sent (default SAX behaviour).
endDTD
event. Thus, in order to maintain SAX compatibility,
this feature cannot be true by default for SAX. Setting this feature to false
can result in loss of information, if notations and unparsed entities were
needed to resolve references in the document.
endDTD
event from the source document is sent. If an XIncludeHandler
is
not present in your pipeline, the value of this feature is irrelevant.