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 ]
  • To: Michael Kay <mike@saxonica.com>, 'Paul Spencer' <xml-dev-list@boynings.co.uk>, xml-dev@lists.xml.org
  • Subject: RE: [xml-dev] minOccurs maxOccurs doesnt seem to be working correctly in my schema
  • From: Marielou <marielou_h@yahoo.co.uk>
  • Date: Wed, 14 Jun 2006 11:14:53 +0100 (BST)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=pqHukN7D4teekz6ZHJF7Ck9fzwOFPWeQBoA105jkE9jO7f/oKA9/5npKgyjln9ISAXTa0CqxYoAgUvE4PzvEmnu1slNMbaFuPzeiXJSEvrZ3H9IJ4SJ/RsqkamEM6d6sNnST8XmSqaSDtrEYlSoKrB3Fv4DaOUGlrArysmgpisM= ;
  • In-reply-to: <00a301c68f8c$71901820$6401a8c0@turtle>

So is the following expected to work out:
in element A, I have <all> elements occuring 0 or 1
times max:

<xs:element name="A">
<xs:complexType>
<xs:all>
<xs:element ref="progid" minOccurs="1" maxOccurs="1"/>
<xs:element ref="start" minOccurs="1" maxOccurs="1"/>
<xs:element ref="end" minOccurs="1" maxOccurs="1"/>
<xs:element ref="pil" minOccurs="0" maxOccurs="1"/>
...
<xs:element ref="B" minOccurs="0" maxOccurs="1"/>
</xs:all>
</xs:complexType>
</xs:element>

and the elements which need to be able to occur more
than once are referenced in A, but defined outside of
element A. e.g. element ref B has occurences defined
in element B where e.g. in a sequence in B the element
can have maxOccurs "unbounded":

<xs:element name="B">
 <xs:complexType>
  <xs:sequence>
   <xs:element ref="audio" minOccurs="0"
maxOccurs="unbounded"/>
  </xs:sequence>
 </xs:complexType>
</xs:element>

the element referenced in B is then also declared
separately e.g.

<xs:element name="audio">
<xs:simpleType>
<xs:restriction base="xs:decimal">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="8"/>
</xs:restriction>
</xs:simpleType>
</xs:element>

Thanks!

Marie Louise

--- Michael Kay <mike@saxonica.com> wrote:

> > does this disallow using <all> with {min occurs}=0
> or 1, {max 
> > occurs}=1, and using element ref to reference
> another  
> > element which has a <sequence> which can occur
> more than 1x? 
> 
> No. If element B is a child of element A, then the
> content model for B is
> entirely independent of the content model for A.
> 
> Michael Kay
> http://www.saxonica.com/
> 
> 


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