XML Schema

Joined
Jul 27, 2006
Messages
1
Reaction score
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.
 

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,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top