OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] minOccurs maxOccurs doesnt seem to be working correctly in

[ Lists Home | Date Index | Thread Index ]

Im really having problems specifying the occurrences
of elements in my schema without a sequence! I have
declared occurrences for child elements in separate
content models from the parent A, where maxOccurs for
the child may be greater than 1. When I validate a
sample XML the maxOccurs and minOccurs isnt working as
I hope. e.g. below I have specified maxOccurs for
elements in a sequence in B, i.e. element C, to be 7
and minOccurs to be 1, however in my sample XML
document I can have over 7 elements or even no C
elements passing validation.  

</xs:element>
<xs:element name="parentA">
<xs:complexType>
<xs:all>
<xs:element ref="B" minOccurs="1" maxOccurs="1"/>
</xs:all>
</xs:complexType>
</xs:element>


<xs:element name="B">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="7">
<xs:element name="C">
<xs:simpleType>
<xs:restriction base="xs:decimal">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="8"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

Any help would be greatly appreciated!

Marie Louise

Send instant messages to your online friends http://uk.messenger.yahoo.com 




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS