diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2013-10-22 17:15:20 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2013-10-22 17:15:20 +0000 |
commit | e82827107f0da059d01837b72d64dba1029f2b2e (patch) | |
tree | aff068b575f0f3d36bb5c85d6494fb931b373a90 | |
parent | 6c5966390eb0fdeb8c4b7cc5231e6244cdd53512 (diff) | |
download | xmlgraphics-fop-e82827107f0da059d01837b72d64dba1029f2b2e.tar.gz xmlgraphics-fop-e82827107f0da059d01837b72d64dba1029f2b2e.zip |
FOP-2306: use the URI of the source FO document rather than the config file as a default base URI
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1534704 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/java/org/apache/fop/cli/CommandLineOptions.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/cli/CommandLineOptions.java b/src/java/org/apache/fop/cli/CommandLineOptions.java index 20fcae223..a216e6b3c 100644 --- a/src/java/org/apache/fop/cli/CommandLineOptions.java +++ b/src/java/org/apache/fop/cli/CommandLineOptions.java @@ -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); } |