Class SecureTransformerFactory

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

public final class SecureTransformerFactory extends Object
Creates new, secure TransformerFactory instances.

Beyond the three universal guarantees on org.apache.commons.xml.secure: xsl:import, xsl:include and document() URIs are not resolved.

The guarantees govern what the transform reads, not what it writes: an output instruction like xsl:result-document still writes wherever the stylesheet directs, so an untrusted stylesheet's output destinations must be restricted outside the library.

The guarantees apply to every parser the factory creates internally for the standard TransformerFactory entry points: stylesheet compilation (newTemplates(Source), newTransformer(Source)) and source-document reading at Transformer.transform(Source, Result) time.

The SAXTransformerFactory extension methods (newTransformerHandler(..), newTemplatesHandler(), newXMLFilter(..)), if reachable by casting the returned factory, produce objects carrying the same guarantees.

Not a TransformerFactory 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:
  • Method Details