XML Schema

Discussion in 'XML' started by prabhu, Jul 27, 2006.

  1. prabhu

    prabhu

    Joined:
    Jul 27, 2006
    Messages:
    1
    Likes Received:
    0
    Schema is,
    <xs:element name="text">
    <xs:complexType>
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element ref="comment" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element ref="heading" minOccurs="0" maxOccurs="1"/>
    </xs:choice>
    </xs:complexType>
    </xs:element>

    XML is,

    <text>
    <comment>headinf</comment>
    <heading key="asded"/>
    <heading key="asded"/>
    <comment>headinf</comment>
    </text>

    Schema Validator is not throwing any error. But it should throw, because <xs:heading minOccurs="0" maxOccurs="1"> and XML <text> has two <heading> element in it.

    Any help is appreciated.
     
    prabhu, Jul 27, 2006
    #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. Markus
    Replies:
    1
    Views:
    1,936
    Markus
    Nov 23, 2005
  2. Fred Smith
    Replies:
    1
    Views:
    1,200
    Martin Honnen
    Feb 5, 2004
  3. Hari Om
    Replies:
    1
    Views:
    593
    Martin SChukrazy
    Mar 2, 2004
  4. Andy
    Replies:
    0
    Views:
    714
  5. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,573
    Stanimir Stamenkov
    Apr 25, 2005
  6. asciz@starmail.com
    Replies:
    3
    Views:
    4,596
    asciz@starmail.com
    Feb 20, 2007
  7. Matt
    Replies:
    3
    Views:
    574
    Bob Barrows [MVP]
    Apr 23, 2004
  8. huntingseasonson@gmail.com
    Replies:
    5
    Views:
    1,713
    Brian McCauley
    Nov 29, 2006
Loading...