]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
FOP-2306: use the URI of the source FO document rather than the config file as a...
authorVincent Hennebert <vhennebert@apache.org>
Tue, 22 Oct 2013 17:15:20 +0000 (17:15 +0000)
committerVincent Hennebert <vhennebert@apache.org>
Tue, 22 Oct 2013 17:15:20 +0000 (17:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1534704 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/cli/CommandLineOptions.java

index 20fcae2237c758a39357431f4e844843ee3efd15..a216e6b3c6677eabb65e3cce44d423d5a1f0ccd3 100644 (file)
@@ -21,8 +21,10 @@ package org.apache.fop.cli;
 
 // java
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.PrintStream;
 import java.net.URI;
 import java.util.Locale;
@@ -45,6 +47,7 @@ import org.apache.fop.apps.FopFactory;
 import org.apache.fop.apps.FopFactoryBuilder;
 import org.apache.fop.apps.FopFactoryConfig;
 import org.apache.fop.apps.MimeConstants;
+import org.apache.fop.apps.io.ResourceResolverFactory;
 import org.apache.fop.pdf.PDFAMode;
 import org.apache.fop.pdf.PDFEncryptionManager;
 import org.apache.fop.pdf.PDFEncryptionParams;
@@ -1018,7 +1021,10 @@ public class CommandLineOptions {
             fopFactoryBuilder.setComplexScriptFeatures(useComplexScriptFeatures);
         } else {
             try {
-                fopFactoryBuilder = new FopConfParser(userConfigFile).getFopFactoryBuilder();
+                InputStream userConfig = new FileInputStream(userConfigFile);
+                FopConfParser fopConfParser = new FopConfParser(userConfig, baseURI,
+                        ResourceResolverFactory.createDefaultResourceResolver());
+                fopFactoryBuilder = fopConfParser.getFopFactoryBuilder();
             } catch (SAXException e) {
                 throw new FOPException(e);
             }