Hi Folks, The latest version of Saxon (version 9.6.0.6) now handles the void type (i.e., xs:choice with empty content). Here is the void type:
<xs:complexType name="void"> I declare the description element to be of type void:
<xs:element name="cellphone"> If an instance document contains the description element, even if the element is empty, the instance is invalid because the void type means that no instance is valid if it contains description. Thus, this instance is invalid because it contains the description element: <cellphone> Here is the error message that Saxon generates: Validation error on line 9 column 97 of Cellphone.xml: XSD: The content model for element <description> does not allow character content Validating /cellphone[1]/description[1] See http://www.w3.org/TR/xmlschema11-1/#cvc-complex-type clause 2.3 Validation error on line 9 column 97 of Cellphone.xml: XSD: In content of element <description>: Empty content is not allowed.
In fact, nothing is allowed; the type has no valid instances Validation of file Cellphone.xml unsuccessful The following instance is valid because it does not contain the description element: <cellphone> No errors are generated on that instance document. Neat! Thanks Saxon team! /Roger |