Bug #2962
closedLax validation doesn't use the XML namespace schema
100%
Description
When lax validation is initiated, typically from XSLT or XQuery code, the schema for the XML namespace is used only if it has been explicitly imported. This means that xml:id attributes will not be validated as unique unless the XML namespace is imported. Since Saxon has built-in knowledge of the XML namespace it should probably be implicitly imported.
Updated by Michael Kay about 8 years ago
- Status changed from New to Resolved
- Applies to branch 9.7, 9.8 added
- Fix Committed on Branch 9.7, 9.8 added
Added a call to addSchemaForXmlNamespace() to the initializer for EnterpriseConfiguration.
Tested by a QT3 test for fn:idref() generated from the examples in the F+O spec.
Updated by O'Neil Delpratt about 8 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 9.7.0.10 added
Bug fix applied in the Saxon 9.7.0.10 maintenance release
Updated by Michael Kay about 8 years ago
- Status changed from Closed to In Progress
Unfortunately the fix for this issue (included in 9.7.0.10) has a nasty side-effect - creating an EnterpriseConfiguration fails if there is no license file on the classpath. This prevents other methods of supplying a license file working, and prevents fallback to unlicensed mode.
Updated by Michael Kay about 8 years ago
Another side-effect has been reported: SCM files that include declarations of attributes in the XML namespace will no longer load, because they are treated as duplicates.
Updated by Michael Kay about 8 years ago
If I remove the code that adds the XML-namespace schema, the following QT3 tests fail
-s:app-spec-examples -t:fo-test-fn-idref-001
Validation error
XQDY0027: There is one IDREF value with no corresponding ID:
ID21256
See http://www.w3.org/TR/xmlschema11-1/#cvc-id clause 1
in TestSet app-spec-examples
There is one IDREF value with no corresponding ID:
ID21256
Assertion assert-deep-eq ("Brown") failed
Expected success, got error
*** TEST-FAILURE: result err:XQDY0027 Expected success.
-s:app-spec-examples -t:fo-test-fn-idref-002
Validation error
XQDY0027: There is one IDREF value with no corresponding ID:
ID21256
See http://www.w3.org/TR/xmlschema11-1/#cvc-id clause 1
in TestSet app-spec-examples
There is one IDREF value with no corresponding ID:
ID21256
Assertion assert-deep-eq ("Singh") failed
Expected success, got error
Updated by Michael Kay about 8 years ago
See also W3C bug 29975.
I think these two test cases make the assumption that the schema for the XML namespace is implicitly imported, and there is nothing in the spec to justify this assumption. We should change the test cases to explicitly import this namespace (not trivial since they are auto-generated from examples in the spec.)
Updated by O'Neil Delpratt about 8 years ago
- Fixed in Maintenance Release deleted (
9.7.0.10)
Updated by Michael Kay about 8 years ago
- Status changed from In Progress to Resolved
- Fix Committed on Branch deleted (
9.7)
I have changed config.getElementDecl() and config.getAttributeDecl() on the 9.8 branch so that when (a) the requested declaration does not exist, and (b) the target namespace is one of those for which a built-in schema is available (XML, FN, XSI), then the built-in schema is instantiated and the request is repeated. The effect of this is that lax validation of elements and attributes with names such as xml:space or fn:analyze-string-result now performs validation rather than causing it to be skipped.
Having been bitten by the side-effects of the previous attempt at solving this, I'm going to make this solution apply to 9.8 only.
Updated by O'Neil Delpratt almost 8 years ago
- Status changed from Resolved to Closed
- Fixed in Maintenance Release 9.7.0.15 added
Bug fix applied to the Saxon 9.7.0.15 maintenance release
Updated by O'Neil Delpratt over 7 years ago
- Fix Committed on Branch trunk added
- Fix Committed on Branch deleted (
9.8)
Please register to edit this issue