Package org.apache.xalan.xslt

Examples of org.apache.xalan.xslt.XSLTInputSource


   throws java.io.IOException,
          java.net.MalformedURLException

   {
     StringReader readerInput = new StringReader (input);
     XSLTInputSource XSLinput = new XSLTInputSource (readerInput);

  StringWriter outBuffer = new StringWriter();
  XSLTResultTarget XSLoutput = new XSLTResultTarget(outBuffer)
try {
  XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
  processor.process(XSLinput, new XSLTInputSource(templateName),
                          XSLoutput);
} catch (Exception e) {
  e.printStackTrace();
}
  String result = XSLoutput.getCharacterStream().toString();
View Full Code Here


   public String processDOM (Document input, String templateName)
   throws java.io.IOException,
          java.net.MalformedURLException

   {
     XSLTInputSource XSLinput = new XSLTInputSource (input);

  StringWriter outBuffer = new StringWriter();
  XSLTResultTarget XSLoutput = new XSLTResultTarget(outBuffer)
try {
  // Set up the XSLTProcessor to use XercesLiaison.
  XSLTProcessor processor = XSLTProcessorFactory.getProcessor
                                  (new org.apache.xalan.xpath.xdom.XercesLiaison());

  processor.process(XSLinput, new XSLTInputSource(templateName),
                          XSLoutput);
} catch (Exception e) {
  e.printStackTrace();
}
  String result = XSLoutput.getCharacterStream().toString();
View Full Code Here

                                                       
    try{
          XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
   
  
          processor.process(new XSLTInputSource(newsURL),
                            new XSLTInputSource("http://home.nordija.dk/news.xsl"),
                            new XSLTResultTarget(wrt));
  
   
         }
          catch(org.xml.sax.SAXException se){
View Full Code Here

            // Create the 3 objects the XSLTProcessor needs to perform the transformation.
            // Fix up the args...
            XMLParserLiaison xmlPL = processor.getXMLProcessorLiaison();
            URL urlTmp = xmlPL.getURLFromString(foFile, null);
            MessageHandler.errorln("xml: " + urlTmp);
            XSLTInputSource xmlSource =
              new XSLTInputSource (urlTmp.toString());
            urlTmp = xmlPL.getURLFromString(xsltFile, null);
            MessageHandler.errorln("xslt: " + urlTmp);
            XSLTInputSource xslSheet =
              new XSLTInputSource (urlTmp.toString());

            XSLTResultTarget xmlResult = new XSLTResultTarget (writer);

            // Perform the transformation.
            processor.process(xmlSource, xslSheet, xmlResult);
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

            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

    // 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("foo.xml"),
                      new XSLTInputSource("foo.xsl"),
                      new XSLTResultTarget(System.out));
  }
View Full Code Here

           java.net.MalformedURLException,
           org.xml.sax.SAXException
  {
    XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
   
    XSLTInputSource xmlID = new XSLTInputSource("foo.xml");
    XSLTInputSource stylesheetID = new XSLTInputSource("foo.xsl");
    Document out = new org.apache.xerces.dom.DocumentImpl();
    XSLTResultTarget resultTarget = new XSLTResultTarget(out);
    processor.process(xmlID, stylesheetID, resultTarget);
   
    PrintWriter pw = new PrintWriter( System.out );
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.