Skip to content

Commit

Permalink
Fix issue #140 by making sure that if a saxon-configuration file is s…
Browse files Browse the repository at this point in the history
…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 0ede5a7
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/com/xmlcalabash/core/XProcConfiguration.java
Expand Up @@ -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();
Expand All @@ -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();
}
}

Expand Down

0 comments on commit 0ede5a7

Please sign in to comment.