You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2013/10/22 19:15:21 UTC

svn commit: r1534704 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java

Author: vhennebert
Date: Tue Oct 22 17:15:20 2013
New Revision: 1534704

URL: http://svn.apache.org/r1534704
Log:
FOP-2306: use the URI of the source FO document rather than the config file as a default base URI

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java?rev=1534704&r1=1534703&r2=1534704&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java Tue Oct 22 17:15:20 2013
@@ -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);
             }



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org