From e82827107f0da059d01837b72d64dba1029f2b2e Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Tue, 22 Oct 2013 17:15:20 +0000 Subject: [PATCH] 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 --- src/java/org/apache/fop/cli/CommandLineOptions.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); } -- 2.39.5