Menu

#592 schema-element() and nillability

v8.8
closed
5
2012-10-08
2006-09-20
Michael Kay
No

The specification for the type test

schema-element(E)

says that it should succeed if either (a) the element
declaration E is nillable, or (b) the element instance
is not nilled.

Currently it fails to match if the element instance is
nilled, regardless of whether the declaration is nillable.

Affects W3C test schvalid015.

I have not patched this in Subversion because it
changes the interface between Saxon-B and Saxon-SA
code. For my own records, the fix involves (a) changing
SchemaDeclaration to expose the isNillable() method of
ElementDecl, with an always-false implementation in
AttributeDecl, (b) changing ExpressionParser to test
this property and call
contentTest.setNillable(nillable) on line 1612.

Discussion