If you have created a DOM document builder or a SAX parser using the JAXP interfaces, the following instructions tell you how to set properties 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 properties on the underlying parser. When
using Xerces, you can set the value of a property with this method.
For example:
The SAXParser interface contains a
setProperty(String,Object) method which can be used
to set properties on the underlying implementation of XMLReader.
You can also retrieve the underlying XMLReader from the
SAXParser allowing you to set and query properties on it directly.
For example:
org.apache.xerces.util.SecurityManager class
contains a number of methods that allow applications to tailor Xerces's
tolerance of document constructs that could result in the heavy
consumption of system resources (see the javadoc of this class for
details). Default values that should be appropriate for many
environments are provided when the class is instantiated. Xerces will not
behave in a strictly spec-compliant way when this property is set.
By default, this property is not set; Xerces's behaviour is therefore strictly
spec-compliant by default.
org.w3c.dom.Document interface. The
implementation used must have a zero argument constructor.