Package net.sf.saxon

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


    }

    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

   */
  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

    /**
     * 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

//            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

TOP

Related Classes of net.sf.saxon.TransformerFactoryImpl

Copyright © 2018 www.massapicom. 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.