If you have created a DOM document builder or a SAX parser using the JAXP interfaces, you may have difficulty setting features and properties directly using those 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
setAttribute(String,Object)
method which may
provide a means to set features and properties on the underyling
parser. However, it cannot be relied upon. Therefore, you must
use the Xerces DOMParser object directly. For example:
Using the SAXParser interface in JAXP is better because you can query the underlying XMLReader implementation directly and that interface contains methods to set and query features and properties. For example:
true
is undetermined! Therefore use
this feature with extreme caution because the parser may get stuck
in an infinite loop or worse.
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 sustitution text will
be created.
EntityReference
nodes in the DOM tree. The document will always contain the entity
reference child nodes.
TextImpl#isIgnorableWhitespace():boolean
method.
java.lang.String#intern(String):String
method.
String#intern()
method.