From b676cebe61b0f21170fb6b77eb9c4a61edf9100a Mon Sep 17 00:00:00 2001 From: Kelly Campbell Date: Wed, 17 Jan 2001 19:22:19 +0000 Subject: [PATCH] Added a transform method which takes a writer to support XalanCommandLine properly. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193972 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/tools/xslt/Xalan1Transform.java | 25 ++++++++++++++++--- 1 file 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); + } } -- 2.39.5