[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: minOccurs maxOccurs doesnt seem to be working correctly in

  • To: Michael Kay <mike@s...>, 'Paul Spencer' <xml-dev-list@b...>, xml-dev@l...
  • Subject: RE: minOccurs maxOccurs doesnt seem to be working correctly in my schema
  • From: Marielou <marielou_h@y...>
  • 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>

xs element maxoccurs unbounded
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@s...> 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 

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.