XML Schema

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

  1. prabhu

    prabhu

    Joined:
    Jul 27, 2006
    Messages:
    1
    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. 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,674
    Markus
    Nov 23, 2005
  2. Fred Smith
    Replies:
    1
    Views:
    1,002
    Martin Honnen
    Feb 5, 2004
  3. Hari Om
    Replies:
    1
    Views:
    482
    Martin SChukrazy
    Mar 2, 2004
  4. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,333
    Stanimir Stamenkov
    Apr 25, 2005
  5. asciz@starmail.com
    Replies:
    3
    Views:
    3,186
    asciz@starmail.com
    Feb 20, 2007
Loading...

Share This Page