Securing a Transformer Factory

Securing Transformer Factory

The use of XML Hardener for securing TransformerFactory is analogical to the other factories for DOM and SAX parsing

  • To secure the TransformerFactory, import the following facade:
  • As a result, the returned TransformerFactory is immediately secured and is instance of HardenedTransformerFactory.

The method with parameters TransformerFactory and String namespace is used for external configuration file. The second parameter identifies which exactly configuration file to be used.

public static TransformerFactory secureTransformerFactory(final TransformerFactory factory, final String callerNamespace)
        throws TransformerConfigurationException