You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ke...@apache.org on 2001/01/17 20:22:20 UTC
cvs commit: xml-fop/src/org/apache/fop/tools/xslt Xalan1Transform.java
kellyc 01/01/17 11:22:19
Modified: src/org/apache/fop/tools/xslt Xalan1Transform.java
Log:
Added a transform method which takes a writer to support
XalanCommandLine properly.
Revision Changes Path
1.2 +22 -3 xml-fop/src/org/apache/fop/tools/xslt/Xalan1Transform.java
Index: Xalan1Transform.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/tools/xslt/Xalan1Transform.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Xalan1Transform.java 2001/01/16 08:00:50 1.1
+++ Xalan1Transform.java 2001/01/17 19:22:19 1.2
@@ -127,8 +127,8 @@
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 @@
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);
+ }
}