Example usage for javax.xml.transform.sax SAXTransformerFactory newTemplates

List of usage examples for javax.xml.transform.sax SAXTransformerFactory newTemplates

Introduction

In this page you can find the example usage for javax.xml.transform.sax SAXTransformerFactory newTemplates.

Prototype

public abstract Templates newTemplates(Source source) throws TransformerConfigurationException;

Source Link

Document

Process the Source into a Templates object, which is a a compiled representation of the source.

Usage

From source file:org.dcm4che.tool.findscu.FindSCU.java

private TransformerHandler getTransformerHandler() throws Exception {
    SAXTransformerFactory tf = saxtf;
    if (tf == null)
        saxtf = tf = (SAXTransformerFactory) TransformerFactory.newInstance();
    if (xsltFile == null)
        return tf.newTransformerHandler();

    Templates tpls = xsltTpls;/*from   www.jav a2  s.  co  m*/
    if (tpls == null)
        ;
    xsltTpls = tpls = tf.newTemplates(new StreamSource(xsltFile));

    return tf.newTransformerHandler(tpls);
}

From source file:org.dcm4che3.tool.findscu.FindSCU.java

private TransformerHandler getTransformerHandler() throws Exception {
    SAXTransformerFactory tf = saxtf;
    if (tf == null)
        saxtf = tf = (SAXTransformerFactory) TransformerFactory.newInstance();
    if (xsltFile == null)
        return tf.newTransformerHandler();

    Templates tpls = xsltTpls;/*w w  w. j  a  va 2  s.com*/
    if (tpls == null)
        xsltTpls = tpls = tf.newTemplates(new StreamSource(xsltFile));

    return tf.newTransformerHandler(tpls);
}

From source file:org.dcm4che3.tool.wadouri.WadoURI.java

private static TransformerHandler getTransformerHandler(WadoURI main) throws Exception {

    SAXTransformerFactory stf = main.saxTransformer;

    if (stf == null)
        main.saxTransformer = stf = (SAXTransformerFactory) TransformerFactory.newInstance();

    if (main.getXsltFile() == null)
        return stf.newTransformerHandler();

    Templates templates = main.xsltTemplates;

    if (templates == null) {
        templates = stf.newTemplates(new StreamSource(main.xsltFile));
        main.xsltTemplates = templates;/*w ww .j  a v a2 s  .  c om*/
    }

    return stf.newTransformerHandler(templates);
}