Examples of TransformerFactoryImpl


Examples of net.sf.saxon.TransformerFactoryImpl

    }

    public static void applyTransformation(Source xml, Source xsl, Writer resultWriter) {
        Controller transformer = null;
        try {
            transformer = (Controller) new TransformerFactoryImpl().newTransformer(xsl);
            Result result = new StreamResult(resultWriter);
            transformer.transform(xml, result);
        } catch (TransformerException e) {
            throw new ReportGenerationException(e);
        } finally {
View Full Code Here

Examples of net.sf.saxon.TransformerFactoryImpl

   */
  public static <T> String doXSLT20(Source xmlSource, Source xsltSource, Map<String, T> parameters, URIResolver resolver) throws TransformerConfigurationException, TransformerException {
    // Prepare transformer
    ByteArrayOutputStream transformOut = new ByteArrayOutputStream();
    Result result = new StreamResult(transformOut);
    TransformerFactory transFact = new TransformerFactoryImpl();
    if (resolver != null) {
      transFact.setURIResolver(resolver);
    }
    // Perform Transform
    Transformer trans = transFact.newTransformer(xsltSource);
    // set the parameters that are passed to the stylesheet
    if (parameters != null) {
      Iterator<Entry<String, T>> it = parameters.entrySet().iterator();
      while (it.hasNext()) {
        Entry<String, T> entry = it.next();
View Full Code Here

Examples of net.sf.saxon.TransformerFactoryImpl

    /**
     * Transform a document supplied via the pull interface
     */

    public void transform(PullProvider in, File stylesheet, OutputStream out) throws TransformerException {
        TransformerFactory factory = new TransformerFactoryImpl();
        Templates templates = factory.newTemplates(new StreamSource(stylesheet));
        Transformer transformer = templates.newTransformer();
        transformer.transform(
                new PullSource(in),
                new StreamResult(out)
        );
View Full Code Here

Examples of net.sf.saxon.TransformerFactoryImpl

//            System.setProperty("java.xml.transform.TransformerFactory", factoryName);
            TransformerFactory factory;
            if (sa) {
                factory = new SchemaAwareTransformerFactory();
            } else {
                factory = new TransformerFactoryImpl();
            }
            Configuration config = ((TransformerFactoryImpl)factory).getConfiguration();
            if (lazy) {
                config.setLazyConstructionMode(true);
            }
View Full Code Here

Examples of org.apache.xalan.processor.TransformerFactoryImpl

import org.apache.xalan.processor.TransformerFactoryImpl;

public class StreamSourceToOMResultTest extends TestCase {
    public static TestSuite suite() throws Exception {
        return StreamSourceToOMResultTestCase.suite(new OMLinkedListMetaFactory(),
                new TransformerFactoryImpl());
    }
View Full Code Here

Examples of org.apache.xalan.processor.TransformerFactoryImpl

    protected void setUp() throws Exception {
        super.setUp();

        // Get a factory for creating transformer related objects.
        saxTransformerFactory = new TransformerFactoryImpl();
    }
View Full Code Here

Examples of org.apache.xalan.processor.TransformerFactoryImpl

import org.apache.xalan.processor.TransformerFactoryImpl;

public class OMSourceToStreamResultTest extends TestCase {
    public static TestSuite suite() throws Exception {
        return OMSourceToStreamResultTestCase.suite(new OMLinkedListMetaFactory(),
                new TransformerFactoryImpl());
    }
View Full Code Here

Examples of org.apache.xalan.processor.TransformerFactoryImpl

import org.apache.xalan.processor.TransformerFactoryImpl;

public class OMSourceToStreamResultTest extends TestCase {
    public static TestSuite suite() throws Exception {
        return OMSourceToStreamResultTestCase.suite(new OMDOMMetaFactory(),
                new TransformerFactoryImpl());
    }
View Full Code Here

Examples of org.apache.xalan.processor.TransformerFactoryImpl

import org.apache.xalan.processor.TransformerFactoryImpl;

public class StreamSourceToOMResultTest extends TestCase {
    public static TestSuite suite() throws Exception {
        return StreamSourceToOMResultTestCase.suite(new OMDOMMetaFactory(),
                new TransformerFactoryImpl());
    }
View Full Code Here

Examples of org.apache.xalan.processor.TransformerFactoryImpl

            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setNamespaceAware(true);
            Document doc = dbf.newDocumentBuilder().parse(testFileContent);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            // Use Xalan's factory directly to avoid issues if Saxon is selected as default
            new TransformerFactoryImpl().newTransformer().transform(
                    new DOMSource(doc.getDocumentElement()), new StreamResult(baos));
            return new InputSource(new ByteArrayInputStream(baos.toByteArray()));
        } finally {
            testFileContent.close();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.