Bug #3952
closedSchemaValidator 'lax' option causes crash
100%
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
Updated by O'Neil Delpratt about 6 years ago
- 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.
Updated by O'Neil Delpratt about 6 years ago
- File SchemaValidator.h SchemaValidator.h added
- File SchemaValidator.cpp SchemaValidator.cpp added
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.
Updated by O'Neil Delpratt over 5 years ago
- 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.
Updated by O'Neil Delpratt over 5 years ago
- 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.
Updated by O'Neil Delpratt over 5 years ago
As a workaround the following will work the same way as setLax
:
XdmAtomicValue value = processor.makeBooleanValue(true);
sv.setParameter(“lax", value);
Updated by O'Neil Delpratt over 5 years ago
- 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.
Updated by O'Neil Delpratt about 5 years ago
- 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