From e4dfc7fe53f6987f08cdbe568c612f19aa2e86ee Mon Sep 17 00:00:00 2001 From: Mehdi Houshmand Date: Wed, 4 Jul 2012 15:27:21 +0000 Subject: [PATCH] Fixed regression re:strict-validation parameter in fop.xconf git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1357307 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/apps/FopConfParser.java | 14 +++++++++++--- .../org/apache/fop/cli/CommandLineOptions.java | 5 +++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/java/org/apache/fop/apps/FopConfParser.java b/src/java/org/apache/fop/apps/FopConfParser.java index bf39a53f0..c6e3dbd19 100644 --- a/src/java/org/apache/fop/apps/FopConfParser.java +++ b/src/java/org/apache/fop/apps/FopConfParser.java @@ -142,12 +142,20 @@ public class FopConfParser { log.debug("Initializing FopFactory Configuration"); } - // TODO: This makes this variable both strict FO and user-config validation, is that right? - boolean strict = false; // strict fo validation if (cfg.getChild("strict-validation", false) != null) { try { - strict = cfg.getChild("strict-validation").getValueAsBoolean(); + boolean strict = cfg.getChild("strict-validation").getValueAsBoolean(); + fopFactoryBuilder.setStrictFOValidation(strict); + } catch (ConfigurationException e) { + LogUtil.handleException(log, e, false); + } + } + + boolean strict = false; + if (cfg.getChild("strict-configuration", false) != null) { + try { + strict = cfg.getChild("strict-configuration").getValueAsBoolean(); fopFactoryBuilder.setStrictUserConfigValidation(strict); } catch (ConfigurationException e) { LogUtil.handleException(log, e, false); diff --git a/src/java/org/apache/fop/cli/CommandLineOptions.java b/src/java/org/apache/fop/cli/CommandLineOptions.java index aa402aa6a..5a770c3ba 100644 --- a/src/java/org/apache/fop/cli/CommandLineOptions.java +++ b/src/java/org/apache/fop/cli/CommandLineOptions.java @@ -1031,14 +1031,15 @@ public class CommandLineOptions { FopFactoryBuilder fopFactoryBuilder; if (userConfigFile == null) { fopFactoryBuilder = new FopFactoryBuilder(new File(".").toURI()); + fopFactoryBuilder.setStrictFOValidation(strictValidation); + fopFactoryBuilder.setTargetResolution(targetResolution); + fopFactoryBuilder.setComplexScriptFeatures(useComplexScriptFeatures); } else { try { fopFactoryBuilder = new FopConfParser(userConfigFile).getFopFactoryBuilder(); } catch (SAXException e) { throw new FOPException(e); } - fopFactoryBuilder.setStrictFOValidation(strictValidation); - fopFactoryBuilder.setComplexScriptFeatures(useComplexScriptFeatures); } factory = fopFactoryBuilder.build(); } -- 2.39.5