About schema : duplicate element definition or reference

Discussion in 'XML' started by cr, Aug 8, 2003.

  1. cr

    cr Guest

    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?
    cr, Aug 8, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,497
    Markus
    Nov 23, 2005
  2. John Jørgensen

    XML schema: duplicate element occurences

    John Jørgensen, Jul 7, 2004, in forum: XML
    Replies:
    2
    Views:
    1,028
    John Jørgensen
    Jul 9, 2004
  3. Abhinav
    Replies:
    6
    Views:
    1,058
    Abhinav
    Aug 16, 2004
  4. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,171
    Stanimir Stamenkov
    Apr 25, 2005
  5. Replies:
    1
    Views:
    502
    George Bina
    Jul 20, 2006
Loading...

Share This Page