Package org.apache.xalan.xslt

Examples of org.apache.xalan.xslt.XSLTProcessor


*
* @ant.task ignore="true"
*/
public class Xalan1Executor extends XalanExecutor {
    void execute() throws Exception {
        XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
        // need to quote otherwise it breaks because of "extra illegal tokens"
        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();
        try {
            XSLTResultTarget target = new XSLTResultTarget(os);
            processor.process(xml_src, xsl_src, target);
        } finally {
            os.close();
        }
    }
View Full Code Here


     * Returns the document resulting of the XSL stylesheets
     * transformations.
     */
    public static Reader transform(Reader r, List sl) {
        try {
            XSLTProcessor p = XSLTProcessorFactory.getProcessor();

            Iterator it = sl.iterator();
            while (it.hasNext()) {
                String uri = (String)it.next();
                Node n = (Node)it.next();

                XSLTInputSource is = new XSLTInputSource(n);
                is.setSystemId(uri);
                StylesheetRoot ss = p.processStylesheet(is);

                StringWriter w = new StringWriter();

                ss.process(new XSLTInputSource(r), new XSLTResultTarget(w));
                r = new StringReader(w.getBuffer().toString());
View Full Code Here

TOP

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

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.