public static final class XmlReadingFeatures.Xerces extends Object
Based on revision 1872634 of the official Xerces features documentation
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 method
DocumentBuilderFactory.setFeature(String, boolean)
can be used to set features on the underlying parser. For example:
import javax.xml.parsers.DocumentBuilderFactory; DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); documentBuilderFactory.setNamespaceAware(true); documentBuilderFactory.setFeature(XercesFeatures.General.ALLOW_JAVA_ENCODINGS, true);
The method
SAXParserFactory.setFeature(String, boolean)
method
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:
import javax.xml.parsers.SAXParser; import org.xml.sax.XMLReader; SAXParser saxParser = ...; XMLReader xmlReader = saxParser.getXMLReader(); xmlReader.setFeature(XercesFeatures.General.ALLOW_JAVA_ENCODINGS, true);
Modifier and Type | Class and Description |
---|---|
static class |
XmlReadingFeatures.Xerces.DOM
DOM Features
|
static class |
XmlReadingFeatures.Xerces.General
General Features
|
static class |
XmlReadingFeatures.Xerces.SAX
SAX Features
|
static class |
XmlReadingFeatures.Xerces.XInclude
XInclude Features (experimental)
|
Copyright © 2025. All rights reserved.