Possible Bug with Saxon Schema Validation
Posted: Tue Feb 16, 2021 6:32 pm
Hi,
i'd like to construct a XML Schema C (XSD Version 1.1), which includes an XML Schema B (without any version attributes) and imports another XML Schema A (XSD Version 1.1). The Idea is that i can extend a complexType from B by an xs:assert Element, which, in its test condition, references a Type from the imported Schema A.
When i validate the Schema C, which imports A and includes B
This happens in XML Editor 22.1, build 2020100710 on Windows.
Schema A (XSD Version 1.1) defines the simple Type:
Schema B (without Version Attributes) defines the complex Type:
Schema C (XSD Version 1.1) imports A and includes B, because i'd like to extend a Type from B. But Saxon says that the target namespace from Schema A has not been imported in the static context.
Thanks in advance,
Frank Steimke
i'd like to construct a XML Schema C (XSD Version 1.1), which includes an XML Schema B (without any version attributes) and imports another XML Schema A (XSD Version 1.1). The Idea is that i can extend a complexType from B by an xs:assert Element, which, in its test condition, references a Type from the imported Schema A.
When i validate the Schema C, which imports A and includes B
- there is no error with XERCES;
- But SAXON reports an Error: "Atomic type ns1:Token3 exists, but its target namespace has not been imported in the static context"
This happens in XML Editor 22.1, build 2020100710 on Windows.
Schema A (XSD Version 1.1) defines the simple Type:
Code: Select all
<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//www.namespace.1" xmlns:ns1="http//www.namespace.1">
<xs:simpleType name="Token3">
<xs:restriction base="xs:token">
<xs:length value="3"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
Code: Select all
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified"
targetNamespace="http://www.namespace.2" xmlns:ns2="http://www.namespace.2">
<xs:complexType name="TypeB">
<xs:sequence>
<xs:element maxOccurs="unbounded" name="child" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
Code: Select all
<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://www.namespace.2" xmlns:ns1="http//www.namespace.1"
xmlns:ns2="http://www.namespace.2">
<xs:import namespace="http//www.namespace.1" schemaLocation="schemaA-11.xsd"/>
<xs:include schemaLocation="SchemaB.xsd"/>
<xs:complexType name="ProfiledTypeB">
<xs:complexContent>
<xs:extension base="ns2:TypeB">
<xs:assert test="ns2:child castable as ns1:Token3"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
Frank Steimke