XSD 1.1 saxon:preprocess does not actually preprocess
I am not able to get the saxon:preprocess facet to work. It seems to recognize that it is an allowed element in the content model of , but it does not do the preprocessing or validate my document.
Below is the example I used, similar to the one in the Saxon documentation. I also tried upper-case(.), various other built-in functions, and namespace prefixes on the upper-case function.
<xs:element name="newSize" type="SMLXSizeType"/>
<xs:restriction base="xs:token"> <saxon:preprocess action="upper-case($value)"/> <xs:enumeration value="SMALL"/> <xs:enumeration value="MEDIUM"/> <xs:enumeration value="LARGE"/> <xs:enumeration value="EXTRA LARGE"/> </xs:restriction>
The content "small" of element does not match the required simple type. Value
"small" contravenes the enumeration facet "EXTRA LARGE, LARGE, MEDIUM, SM..." of the type
SMLXSizeType (See http://www.w3.org/TR/xmlschema11-2/#cvc-datatype-valid clause 1)
Validation error on line 2 column 61 of EX83a_1.xml:
XQDY0027: One or more validation errors were reported
#1 Updated by Priscilla Walmsley over 9 years ago
A followup: when I run a test to see if it's available via vc:facetAvailable, it thinks it is not available. Do I need to do something special when invoking Saxon to include these extension facets? (other than use XSD version 1.1, which I already am doing.)
But also, if it thinks the facet is not available, shouldn't it raise an error saying it doesn't understand the facet when I try to use it, rather than silently ignoring it?
#2 Updated by Michael Kay over 9 years ago
- Status changed from New to In Progress
- Assignee set to Michael Kay
- Priority changed from Low to Normal
Confirmed as a bug. It seems that some late change was made before 9.4 release that caused the preprocess code not to be invoked; and unfortunately the test cases had not been fully integrated into the automatic testing programme so the change went unnoticed. The underlying code is all present so it should not be difficult to patch the feature back in.
Please register to edit this issue