About schema : duplicate element definition or reference

C

cr

Could somebody tell me whether the use of duplicate element definition
or reference are permitted in XML schemas?

For example:

<complexType name="PurchaseOrderType">
<sequence>
<element name="shipTo" type="string"/>
<element name="shipTo" type="string"/>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<element name="billTo" type="ipo:Address"/>
<element ref="ipo:comment" minOccurs="0"/>
<element ref="ipo:comment" minOccurs="2"/>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<element name="Items" type="ipo:Items"/>
</sequence>
<attribute name="orderDate" type="date"/>
</complexType>

In XMLSpy 5.0 this schema fragment can pass the validation.
The element "shipTo" is duplicate defined, why it can pass the
validation.
And how can I distinguish the element "ipo:comment" in xml instance?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top