]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Only build the DOM if needed for mergefile. Otherwise pass input xml file directly...
authorKaren Lease <klease@apache.org>
Sun, 26 Aug 2001 14:20:26 +0000 (14:20 +0000)
committerKaren Lease <klease@apache.org>
Sun, 26 Aug 2001 14:20:26 +0000 (14:20 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194441 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/tools/anttasks/Xslt.java

index 1bc56492a906d5684b52a95c8b4f9a080c557fc0..ed660fa20818b48051ff412eca9c01d2a21ddcce 100644 (file)
@@ -155,14 +155,24 @@ public class Xslt extends Task {
      */
     private void transform() {
         try {
-            org.w3c.dom.Document source = buildDocument(infile);
+           org.w3c.dom.Document source = null;
+           if (mergefile != null && !mergefile.equals("")) {
+               source = buildDocument(infile);
+           }
             // Perform the transformation.
             System.out.println("============================");
             System.out.println("xslt \nin: " + infile + "\nstyle: "
                                + xsltfile + "\nout: " + outfile);
             System.out.println("============================");
-            org.apache.fop.tools.xslt.XSLTransform.transform(source,
+           if (source != null) {
+                org.apache.fop.tools.xslt.XSLTransform.transform(source,
                     xsltfile, outfile);
+           }
+           else {
+               // Read the xml file directly
+               org.apache.fop.tools.xslt.XSLTransform.transform(infile,
+                    xsltfile, outfile);
+           }
 
 
         } catch (org.xml.sax.SAXException saxerror) {