Possible Bug with XML Schema 1.1 override
Posted: Mon Feb 15, 2021 12:57 am
Hi,
I have to use the XSD Schema 1.1 feature xs:override for the first time, and found something that looks like a bug. The real use Case deals with a complex ebXML Schema construct (XML Schema 1.0). For the purpose of demonstration i have two very simple Schema files.
The first one has no versioning attributes in the Namespace http://www.w3.org/2007/XMLSchema-versioning . It is called Base.xsd and defines the global root Element with child Elements called child
The second Schema File called Overriding.xsd is of Version 1.1. I overrides the root Element from Base.xsd, so that child Elements are called subelement.
What happens is that when i validate the Overriding Schema File with XERCES as Default Schema Validation Engine, the schema File is valid;
But when i validate the same Overriding Schema File with Saxon EE, i get the following Error:
System ID: /home/frank/override.xsl
Main validation file: /home/frank/test/Overriding.xsd
Engine name: Saxon-EE 9.9.1.7
Severity: error
Description: <xs:schema> must be the outermost element in a schema document
It is most interesting, that the Resource / System ID says "/home/frank/override.xsl", although there is no such file.
This happens in Oxygen 23 build 2020111805 on Linux.
Thanks in Advance,
Frank
I have to use the XSD Schema 1.1 feature xs:override for the first time, and found something that looks like a bug. The real use Case deals with a complex ebXML Schema construct (XML Schema 1.0). For the purpose of demonstration i have two very simple Schema files.
The first one has no versioning attributes in the Namespace http://www.w3.org/2007/XMLSchema-versioning . It is called Base.xsd and defines the global root Element with child Elements called child
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
targetNamespace="http://demo.com" xmlns:tns="http://demo.com">
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="child" type="xs:token"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified"
vc:minVersion="1.1" targetNamespace="http://demo.com" xmlns:tns="http://demo.com">
<xs:override schemaLocation="Base.xsd">
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="subelement" maxOccurs="unbounded" type="xs:positiveInteger"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:override>
</xs:schema>
But when i validate the same Overriding Schema File with Saxon EE, i get the following Error:
System ID: /home/frank/override.xsl
Main validation file: /home/frank/test/Overriding.xsd
Engine name: Saxon-EE 9.9.1.7
Severity: error
Description: <xs:schema> must be the outermost element in a schema document
It is most interesting, that the Resource / System ID says "/home/frank/override.xsl", although there is no such file.
This happens in Oxygen 23 build 2020111805 on Linux.
Thanks in Advance,
Frank