Class SecureSAXParserFactory

java.lang.Object
org.apache.commons.xml.secure.SecureSAXParserFactory

public final class SecureSAXParserFactory extends Object
Creates new, secure SAXParserFactory instances.

Beyond the three universal guarantees on org.apache.commons.xml.secure, XInclude resolution is denied by default. When setXIncludeAware(true) is called on the returned factory, the parser will process xi:include elements but every external resource lookup is rejected. To permit specific trusted resources, install an EntityResolver on the XMLReader that allow-lists them; any href the resolver does not explicitly allow stays blocked.

Not a SAXParserFactory itself, so none of the JAXP static factory methods is inherited: a caller cannot reach a non-secured factory through this class by calling an inherited method such as newDefaultInstance(). The secure factories are instances of a nested, non-public wrapper class.

See Also: