From: Kelly Campbell Date: Wed, 17 Jan 2001 19:22:19 +0000 (+0000) Subject: Added a transform method which takes a writer to support X-Git-Tag: fop-0_17_0~89 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b676cebe61b0f21170fb6b77eb9c4a61edf9100a;p=xmlgraphics-fop.git 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 --- 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); + } }