Bug #4332
closedXML Schema 1.1: user defined simple type is unknown in assertion
0%
Description
Hi,
i have an XML Schema Version 1.1 with an user defined simpleType. I'd like to use that simpleType in an assertion. The idea is, that when the value of an attribute is an instance of the simpletype, there are constraints on other attributes.
However, Saxon tells me the assertion is invalid because the simple type is unknown.
This happens in Oxygen XML Editor 21.1 with Saxon EE 9.8..0.12. Oxygen gives me the opportunity to validate the schema file with Xerces. Doing so shows that the file is valid. So i think it is a bug in Saxon.
I have added a very simple test file.
Sincerely Frank Steimke
Files
Updated by Michael Kay about 5 years ago
- Assignee set to Michael Kay
The static context for evaluation of an XPath expression appearing in an assertion is defined in XML Schema 1.1 part 1 §3.13.6.2 at https://www.w3.org/TR/xmlschema11-1/#xpath-valid
Clause §2.2.5 states that the set of in-scope schema definitions is the set of built-in definitions: that is, you can only reference built-in types and not user-defined types.
The reason for this rule is to prevent circularity. Without it, type A could have an assertion "castable as B", while type B has an assertion "castable as A".
So I think Saxon is doing the right thing here (although I appreciate it's an unwelcome restriction).
Please register to edit this issue