Package org.apache.xalan.xslt

Examples of org.apache.xalan.xslt.XSLTInputSource


      // new XSLTProcessor object.
      XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
     
      // Have the XSLTProcessor processor object transform "foo.xml" to
      // System.out, using the XSLT instructions found in "foo.xsl".
      processor.process(new XSLTInputSource(url),
            new XSLTInputSource(xsl),
            new XSLTResultTarget(out));
  } catch(SAXException sexp) {
      throw new JspException("SAXParser Exception: " + sexp.getMessage());     
  }
    }
View Full Code Here


      // new XSLTProcessor object.
      XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
     
      // Have the XSLTProcessor processor object transform "foo.xml" to
      // System.out, using the XSLT instructions found in "foo.xsl".
      processor.process(new XSLTInputSource(url),
            new XSLTInputSource(xsl),
            new XSLTResultTarget(out));
  } catch(SAXException sexp) {
      throw new JspException("SAXParser Exception: " + sexp.getMessage());     
  }
    }
View Full Code Here

      // Use XSLTProcessorFactory to instantiate an XSLTProcessor.
      XSLTProcessor processor = XSLTProcessorFactory.getProcessor();

      // Create the 3 objects the XSLTProcessor needs to perform the transformation.
      XSLTInputSource xmlSource  = new XSLTInputSource (args[0]);
      XSLTInputSource xslSheet   = new XSLTInputSource (args[1]);
      XSLTResultTarget xmlResult = new XSLTResultTarget (writer);

      // Perform the transformation.
      processor.process(xmlSource, xslSheet, xmlResult);
     
View Full Code Here

    public XalanLiaison() throws Exception {
      processor = XSLTProcessorFactory.getProcessor();
    }

    public void setStylesheet(String fileName) throws Exception {
      xslSheet = new XSLTInputSource (fileName);
    };
View Full Code Here

    public void setStylesheet(String fileName) throws Exception {
      xslSheet = new XSLTInputSource (fileName);
    };

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

            // Fix up the args...
            XMLParserLiaison xmlPL = processor.getXMLProcessorLiaison();
            URL urlTmp = xmlPL.getURLFromString(args[0], null);
            System.err.println("XML File: " + args[0]);
            System.err.println("URL: " + urlTmp);
            XSLTInputSource xmlSource =
              new XSLTInputSource (urlTmp.toString());
            urlTmp = xmlPL.getURLFromString(args[1], null);
            System.err.println("XSL File: " + args[1]);
            System.err.println("URL: " + urlTmp);
            XSLTInputSource xslSheet =
              new XSLTInputSource (urlTmp.toString());

            XSLTResultTarget xmlResult = new XSLTResultTarget (writer);

            // Perform the transformation.
            processor.process(xmlSource, xslSheet, xmlResult);
View Full Code Here


        Document doc = new DocumentImpl();
        try {
            XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
            XSLTInputSource  xml  = new XSLTInputSource(argv[0]);
            XSLTInputSource  xslt = new XSLTInputSource(argv[1]);
            XSLTResultTarget target = new XSLTResultTarget(doc);
            processor.process(xml, xslt, target);
        }
        catch (SAXException e) {
            System.err.println("error: Error processing stylesheet.");
View Full Code Here

            xslStream = new FileInputStream(stylesheet);
            fis = new FileInputStream(infile);
            fos = new FileOutputStream(outfile);
            // systemid such as file:/// + getAbsolutePath() are considered
            // 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
View Full Code Here

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 {
View Full Code Here

    public XalanLiaison() throws Exception {
      processor = XSLTProcessorFactory.getProcessor();
    }

    public void setStylesheet(String fileName) throws Exception {
        xslSheet = new XSLTInputSource (normalize(fileName));
    };
View Full Code Here

TOP

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

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.