Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.6.0, 2.7.0
-
None
Description
input.xml
=================
<?xml version="1.0" encoding="UTF-8"?>
<purchaseOrder xmlns="http://www.openuri.org/mySchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.openuri.org/mySchema xsd.xsd">
<shipTo>
<name>ship-to-name</name>
<element_of_any_type>
<unknown_element xsi:type="USState">AK</unknown_element>
</element_of_any_type>
</shipTo>
<billTo>
<name>bill-to-name</name>
<element_of_any_type/>
</billTo>
</purchaseOrder>
=================
xsd.xsd
=================
<?xml version="1.0"?>
<xsd:schema xmlns="http://www.openuri.org/mySchema"
elementFormDefault="qualified"
targetNamespace="http://www.openuri.org/mySchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<xsd:element name="purchaseOrder" type="PurchaseOrderType" />
<xsd:complexType name="PurchaseOrderType">
<xsd:sequence>
<xsd:element name="shipTo" type="USAddress" />
<xsd:element name="billTo" type="USAddress" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="USAddress">
<xsd:sequence>
<xsd:element name="name" type="xsd:string" />
<xsd:element name="element_of_any_type"/>
</xsd:sequence>
<!-- declaration of this attribute is necesary to reproduce -->
<xsd:attribute fixed="US" name="country" type="xsd:NMTOKEN" />
</xsd:complexType>
<xsd:simpleType name="USState">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="AK"/>
<xsd:enumeration value="AL"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
=================
Validation of input.xml reports follow error:
Error at file input.xml, line 11, char 10
Message: Type 'USState' that is used in xsi:type is not derived from the type of element 'billTo'
reason for this behavior is that SchemaValidator::fXsiType is not cleared after element "unknown_element" processing.