]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Added a transform method which takes a writer to support
authorKelly Campbell <kellyc@apache.org>
Wed, 17 Jan 2001 19:22:19 +0000 (19:22 +0000)
committerKelly Campbell <kellyc@apache.org>
Wed, 17 Jan 2001 19:22:19 +0000 (19:22 +0000)
XalanCommandLine properly.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193972 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/tools/xslt/Xalan1Transform.java

index 413eb5617be5ae1f4cf3c78cffa6b94525aeb1b6..6455f77705925ab51009b6749a7f657595d8753e 100644 (file)
@@ -127,8 +127,8 @@ public class Xalan1Transform
               org.xml.sax.SAXException
     {
        // Create the 3 objects the XSLTProcessor needs to perform the transformation.
-        org.apache.xalan.xslt.XSLTInputSource source =
-          new org.apache.xalan.xslt.XSLTInputSource (xmlSource);
+       /*  org.apache.xalan.xslt.XSLTInputSource source =
+           new org.apache.xalan.xslt.XSLTInputSource (xmlSource); */
         org.apache.xalan.xslt.XSLTResultTarget xmlResult =
           new org.apache.xalan.xslt.XSLTResultTarget (outputFile);
 
@@ -140,5 +140,24 @@ public class Xalan1Transform
                           xmlSource, xmlResult);
     }
     
-    
+       public static void transform(String  xmlSource, 
+                                String xslURL,
+                                java.io.Writer outputFile) 
+       throws java.io.IOException,
+              java.net.MalformedURLException, 
+              org.xml.sax.SAXException
+    {
+       // Create the 3 objects the XSLTProcessor needs to perform the transformation.
+        org.apache.xalan.xslt.XSLTInputSource source =
+          new org.apache.xalan.xslt.XSLTInputSource (xmlSource);
+        org.apache.xalan.xslt.XSLTResultTarget xmlResult =
+          new org.apache.xalan.xslt.XSLTResultTarget (outputFile);
+
+       StylesheetRoot stylesheet = getStylesheet(xslURL,true);
+       
+        // Perform the transformation.
+        stylesheet.process(XSLTProcessorFactory.getProcessor
+                          (new org.apache.xalan.xpath.xdom.XercesLiaison()),
+                         source, xmlResult);
+    }
 }