Bug #3952
closed
SchemaValidator 'lax' option causes crash
Description
When we use the 'lax' option on SchemaValidator it causes a crash.
for example.
validator.setProperty("lax", "true");
Internal error reported when debug is switched on:
Exception in thread "main" java.lang.ClassCastException: java.lang.String
at net.sf.saxon.option.cpp.SchemaValidatorForCpp.applySchemaProperties(Unknown Source)
at net.sf.saxon.option.cpp.SchemaValidatorForCpp.validate(Unknown Source)
The cause is in the SchemaValidatorForCpp Java class does not first convert the string to boolean.
Files
- Status changed from New to Resolved
- % Done changed from 0 to 100
Bug fixed. Made change in the Java class SchemaValidatorForCpp.
Workaround alternatives:
- Set lax option in a config file. But there seems to be an issue with using a config file and SchemaValidation. see bug issue: #3953
- Modify the SchemaValidator.cpp file to pass the expected value for the 'lax' option i.e. Boolean object.
hi,
I have modified the SchemaValidator class with the option 2 workaround from comment #1
Notice we now have a method called setLax(boolean)
used to set the lax option.
- Status changed from Resolved to Closed
- Fixed in version set to 1.1.2
Bug fix applied in the Saxon/C 1.1.2 maintenance release.
- Status changed from Closed to In Progress
- Fixed in version deleted (
1.1.2)
Reported by user:
The setLax() function added to the API Schema Validator as a workaround doesn't exist in the 1.1.2 API.
As a workaround the following will work the same way as setLax
:
XdmAtomicValue value = processor.makeBooleanValue(true);
sv.setParameter(“lax", value);
- Status changed from In Progress to Resolved
setLax method and related code reinserted in SchemaValidator class in svn for both the 1.1 and 1.2 branches.
- Status changed from Resolved to Closed
- Fixed in version set to 1.2.0
Big fix applied in the Saxon/C 1.2.0 release.
Please register to edit this issue
Also available in: Atom
PDF