aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/org/apache/fop/tools/xslt/Xalan1Transform.java25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/org/apache/fop/tools/xslt/Xalan1Transform.java b/src/org/apache/fop/tools/xslt/Xalan1Transform.java
index 413eb5617..6455f7770 100644
--- a/src/org/apache/fop/tools/xslt/Xalan1Transform.java
+++ b/src/org/apache/fop/tools/xslt/Xalan1Transform.java
@@ -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);
+ }
}