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. Advertisements

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. MSNews
    Replies:
    1
    Views:
    2,982
    Alvin Bruney [MVP]
    Apr 22, 2004
  2. Markus
    Replies:
    1
    Views:
    1,945
    Markus
    Nov 23, 2005
  3. Y.S.
    Replies:
    3
    Views:
    1,316
    strajan
    Sep 17, 2003
  4. CJ
    Replies:
    0
    Views:
    859
  5. John Jørgensen

    XML schema: duplicate element occurences

    John Jørgensen, Jul 7, 2004, in forum: XML
    Replies:
    2
    Views:
    1,752
    John Jørgensen
    Jul 9, 2004
  6. Abhinav
    Replies:
    6
    Views:
    1,462
    Abhinav
    Aug 16, 2004
  7. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,581
    Stanimir Stamenkov
    Apr 25, 2005
  8. Replies:
    1
    Views:
    733
    George Bina
    Jul 20, 2006
Loading...