Bug #4332

XML Schema 1.1: user defined simple type is unknown in assertion

Added by Frank Steimke 12 months ago. Updated 12 months ago.

Start date:
Due date:
% Done:


Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:



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

test.xsd (227 Bytes) test.xsd Frank Steimke, 2019-10-03 09:18


#1 Updated by Michael Kay 12 months 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 § at

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).

#2 Updated by Michael Kay 12 months ago

  • Status changed from New to Rejected

Please register to edit this issue

Also available in: Atom PDF