aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKelly Campbell <kellyc@apache.org>2001-01-17 19:22:19 +0000
committerKelly Campbell <kellyc@apache.org>2001-01-17 19:22:19 +0000
commitb676cebe61b0f21170fb6b77eb9c4a61edf9100a (patch)
tree59780e3506a3871541163a5971c2d27bd7d22d3b /src
parent64dd26592d593ebdb941ce4e336f80bf9d0926af (diff)
downloadxmlgraphics-fop-b676cebe61b0f21170fb6b77eb9c4a61edf9100a.tar.gz
xmlgraphics-fop-b676cebe61b0f21170fb6b77eb9c4a61edf9100a.zip
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
Diffstat (limited to 'src')
-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);
+ }
}