Handling element collisions on importing/including XML schemas
Posted
by
eggyal
on Stack Overflow
See other posts from Stack Overflow
or by eggyal
Published on 2012-03-23T22:18:22Z
Indexed on
2012/03/23
23:29 UTC
Read the original article
Hit count: 428
Given schema definitions that define the same element differently, can one import/include both definitions and reference them independently from within a third schema definition?
For example, given:
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:example:namespace">
<element name="message" type="boolean"/>
</schema>
and:
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:example:namespace">
<element name="message" type="date"/>
</schema>
Can one construct the following:
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:example:namespace">
<complexType name="booleanMessageType">
<xs:sequence>
<!-- reference to first definition here -->
</xs:sequence>
</complexType>
<complexType name="dateMessageType">
<xs:sequence>
<!-- reference to second definition here -->
</xs:sequence>
</complexType>
</schema>
© Stack Overflow or respective owner