Package org.apache.xalan.xslt

Examples of org.apache.xalan.xslt.XSLTResultTarget


    System.out.println("------------------");
    // Have the XSLTProcessor processor object transform "foo.xml" to
    // System.out, using the XSLT instructions found in "foo.xsl".
    processor.process(new XSLTInputSource("file:foo.xml"),
                      new XSLTInputSource("file:foo.xsl"),
                      new XSLTResultTarget(System.out));
    System.out.println("\n------------------");
  }
View Full Code Here


     */
    public void transform (String xslName, Reader in, Writer out) throws Exception
    {
        XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
        XSLTInputSource xmlin = new XSLTInputSource(in);
        XSLTResultTarget xmlout = new XSLTResultTarget(out);
       
        transform (xslName,processor,xmlin,xmlout);       
    }
View Full Code Here

     */
    public void transform (String xslName, org.w3c.dom.Node in, Writer out) throws Exception
    {
        XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
        XSLTInputSource xmlin = new XSLTInputSource(in);
        XSLTResultTarget xmlout = new XSLTResultTarget(out);
       
        transform (xslName,processor,xmlin,xmlout);       
    }
View Full Code Here

            // invalid here...
            XSLTInputSource xslSheet = new XSLTInputSource(xslStream);
            xslSheet.setSystemId(stylesheet.getAbsolutePath());
            XSLTInputSource src = new XSLTInputSource(fis);
            src.setSystemId(infile.getAbsolutePath());
            XSLTResultTarget res = new XSLTResultTarget(fos);
            processor.process(src, xslSheet, res);
        } finally {
            // make sure to close all handles, otherwise the garbage
            // collector will close them...whenever possible and
            // Windows may complain about not being able to delete files.
View Full Code Here

        processor.setStylesheetParam("output.dir", "'" + caller.toDir.getAbsolutePath() + "'");
        XSLTInputSource xml_src = new XSLTInputSource(caller.document);
        String system_id = caller.getStylesheetSystemId();
        XSLTInputSource xsl_src = new XSLTInputSource(system_id);
        OutputStream os = getOutputStream();
        XSLTResultTarget target = new XSLTResultTarget(os);
        processor.process( xml_src, xsl_src, target);
    }
View Full Code Here

        throws Exception{
        XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
       
        processor.process(new XSLTInputSource(xmlReport.toURL().toString()),
                          new XSLTInputSource(stylesheet),
                          new XSLTResultTarget(createNewReportOutput().getAbsolutePath()));
    }
View Full Code Here

            // invalid here...
            XSLTInputSource xslSheet = new XSLTInputSource(xslStream);
            xslSheet.setSystemId(stylesheet.getAbsolutePath());
            XSLTInputSource src = new XSLTInputSource(fis);
            src.setSystemId(infile.getAbsolutePath());
            XSLTResultTarget res = new XSLTResultTarget(fos);
            processor.process(src, xslSheet, res);
        } finally {
            // make sure to close all handles, otherwise the garbage
            // collector will close them...whenever possible and
            // Windows may complain about not being able to delete files.
View Full Code Here

        XSLTInputSource xml_src = new XSLTInputSource(caller.document);
        String system_id = caller.getStylesheetSystemId();
        XSLTInputSource xsl_src = new XSLTInputSource(system_id);
        OutputStream os = getOutputStream();
        try {
            XSLTResultTarget target = new XSLTResultTarget(os);
            processor.process(xml_src, xsl_src, target);
        } finally {
            os.close();
        }
    }
View Full Code Here

        xslSheet = new XSLTInputSource (normalize(fileName));
    };

    public void transform(String infile, String outfile) throws Exception {
        processor.process(new XSLTInputSource(normalize(infile)), xslSheet,
                        new XSLTResultTarget(outfile));
    }
View Full Code Here

    // Get and set a DocumentHandler for final output.
    processor.setDocumentHandler(stylesheet2.getSAXSerializer(System.out));

    // Use the processor (which extends DocumentHandler) to instantiate the
    // XSLTResultTarget object for the first transform.
    XSLTResultTarget firstResult = new XSLTResultTarget(processor);
    // firstResult now functions as a SAX DocumentHandler.

    // The first transform (uses foo.xsl to transform foo.xml) produces a sequence of SAX
    // events (firstResult) that are in turn processed by the processor DocumentHandler
    // (using foo2.xsl), sending the ouput of the second transform to System.out.
View Full Code Here

TOP

Related Classes of org.apache.xalan.xslt.XSLTResultTarget

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.