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

Re: One of more elements required

From: G. Ken Holman <gkholman@CraneSoftwrights.com>
Date: Fri, 24 Oct 2008 14:10:07 -0400
Message-Id: <7.0.1.0.2.20081024140912.028e6de0@wheresmymailserver.com>
To: xmlschema-dev@w3.org
Re: One of more elements required

At 2008-10-24 19:43 +0200, Age Bosma wrote:

>Thank you for the reply, sorry for the response delay.
>
>On 23/10/2008, Stan Kitsis <Stan.Kitsis@microsoft.com> wrote:
> > If I understand your requirements right, you want
> >
> >   <xsd:choice minOccurs="1" maxOccurs="unbounded">
> >      <xsd:element name="platform" type="platformType"/>
> >      <xsd:element name="device" type="deviceType"/>
> >   </xsd:choice>
> >
>
>I don't understand. Doesn't the choice limit me to only use one of the
>two elements in the parent element?

Yes, but because of the maxOccurs="unbounded" you get to make that 
choice as many times as you want.

>I'd like to use both (multiple
>times if required) but at least one of the elements should be present.

With the minOccurs="1" you are obliged to make the choice at least once.

I hope this helps.

. . . . . . . . Ken

--
Upcoming XSLT/XSL-FO hands-on courses:      Wellington, NZ 2009-01
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video sample lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg
Video course overview:  http://www.youtube.com/watch?v=VTiodiij6gE
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/x/
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/x/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal
Received on Friday, 24 October 2008 18:08:31 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
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-2007 All Rights Reserved.