Permalink
Browse files

Fix issue #140 by making sure that if a saxon-configuration file is s…

…pecified, the parser settings it contains trump any parser settings requested elsewhere. As a consequence, attempting to request an HE parser when your saxon configuration specifies an EE parser will mean you get an EE parser. Don't do that, if that's not what you want.
  • Loading branch information...
ndw committed Feb 11, 2014
1 parent c5ecb76 commit 0ede5a71d4688236a726935c1945b556e37d2147
Showing with 11 additions and 4 deletions.
  1. +11 −4 src/com/xmlcalabash/core/XProcConfiguration.java
@@ -154,10 +154,17 @@ private void init(String proctype, boolean schemaAware, Input saxoncfg) {
// If we got a schema aware processor, make sure it's reflected in our config
// FIXME: are there other things that should be reflected this way?
this.schemaAware = cfgProcessor.isSchemaAware();
this.saxonProcessor = Configuration.softwareEdition.toLowerCase();
saxonProcessor = Configuration.softwareEdition.toLowerCase();
if (!(proctype == null || saxonProcessor.equals(proctype)) || schemaAware != this.schemaAware ||
(saxoncfg == null && saxonConfig != null)) {
if (saxoncfg != null) {
// If there was a Saxon configuration, then it wins
schemaAware = this.schemaAware;
proctype = saxonProcessor;
}
if (!(proctype == null || saxonProcessor.equals(proctype))
|| schemaAware != this.schemaAware
|| (saxoncfg == null && saxonConfig != null)) {
// Drat. We have to restart to get the right configuration.
nsBindings.clear();
inputs.clear();
@@ -173,7 +180,7 @@ private void init(String proctype, boolean schemaAware, Input saxoncfg) {
// If we got a schema aware processor, make sure it's reflected in our config
// FIXME: are there other things that should be reflected this way?
this.schemaAware = cfgProcessor.isSchemaAware();
this.saxonProcessor = Configuration.softwareEdition.toLowerCase();
saxonProcessor = Configuration.softwareEdition.toLowerCase();
}
}

0 comments on commit 0ede5a7

Please sign in to comment.