Java XML Transform getTransformerFactory()

Here you can find the source of getTransformerFactory()

Description

Convenience method to get a new instance of a TransformerFactory.

License

fedora commons license

Return

a new instance of TransformerFactory

Declaration

public static TransformerFactory getTransformerFactory() 

Method Source Code


//package com.java2s;
/* The contents of this file are subject to the license and copyright terms
 * detailed in the license directory at the root of the source tree (also
 * available online at http://fedora-commons.org/license/).
 *//*from ww w . j a  v a2s.c o  m*/

import javax.xml.transform.TransformerFactory;

public class Main {
    /**
     * Convenience method to get a new instance of a TransformerFactory.
     * If the {@link #TransformerFactory} is an instance of
     * net.sf.saxon.TransformerFactoryImpl, the attribute
     * {@link #FeatureKeys.VERSION_WARNING} will be set to false in order to
     * suppress the warning about using an XSLT1 stylesheet with an XSLT2
     * processor.
     *
     * @return a new instance of TransformerFactory
     */
    public static TransformerFactory getTransformerFactory() {
        TransformerFactory factory = TransformerFactory.newInstance();
        if (factory.getClass().getName().equals("net.sf.saxon.TransformerFactoryImpl")) {
            factory.setAttribute("http://saxon.sf.net/feature/version-warning", Boolean.FALSE);
        }
        return factory;
    }
}

Related

  1. getTransformer(final InputStream xsl)
  2. getTransformer(Source xsltSource)
  3. getTransformer(StreamSource streamSource)
  4. getTransformerFactory()
  5. getTransformerFactory()
  6. getTransformerFactory()
  7. getTransformerFactory()
  8. getTransformerTemplate(javax.xml.transform.Source xsltSource)
  9. getTransformParameterSpec(final Node transformNode, final String namespacePrefix)