Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML Schema --- <xs:choice maxOccurs=5>

Reply
Thread Tools

XML Schema --- <xs:choice maxOccurs=5>

 
 
hooomee@gmail.com
Guest
Posts: n/a
 
      06-05-2006
Given:

<xs:choice maxOccurs=5>
<xs:element name="Foo" type="bar" />
<xs:element name="Foo1" type="bar" />
<xs:element name="Foo2" type="bar" />
</xs:choice>

Is the choice made once and then the choosen element can occur 5 times,
or is the choice made once for each occurance?

I'm looking for the first behavior, choose once, then allow the choosen
element 5 times. I'm not sure how to get that..

 
Reply With Quote
 
 
 
 
Stan Kitsis [MSFT]
Guest
Posts: n/a
 
      06-05-2006
What you have will make five choices. What you want is (replace
min/maxOccurs with whatever boundaries you need):

<xs:choice>
<xs:element name="Foo" type="bar" minOccurs="5" maxOccurs="5"/>
<xs:element name="Foo1" type="bar" minOccurs="5" maxOccurs="5"/>
<xs:element name="Foo2" type="bar" minOccurs="5" maxOccurs="5"/>
</xs:choice>

--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Given:
>
> <xs:choice maxOccurs=5>
> <xs:element name="Foo" type="bar" />
> <xs:element name="Foo1" type="bar" />
> <xs:element name="Foo2" type="bar" />
> </xs:choice>
>
> Is the choice made once and then the choosen element can occur 5 times,
> or is the choice made once for each occurance?
>
> I'm looking for the first behavior, choose once, then allow the choosen
> element 5 times. I'm not sure how to get that..
>



 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      06-05-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Is the choice made once and then the choosen element can occur 5 times,
> or is the choice made once for each occurance?


Simplest way to answer this sort of question is often to try it and see
what it does. (I think the answer is "choose five times", as you want it
to be, but I don't do enough with schemas to be certain and I'd try it
myself.)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
web.xml / XML schema issue, why do some XML schema attributes disappear asciz@starmail.com Java 3 02-20-2007 09:56 AM
Validation with XSD using XML::LibXML::Schema, and XML::Validator::Schema huntingseasonson@gmail.com Perl Misc 5 11-29-2006 12:37 PM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM
XML Schema to XML Schema Conversion Hari Om XML 1 03-02-2004 09:04 PM
XML schema regular expressions question and recommended XML Schema book Fred Smith XML 1 02-05-2004 11:12 AM



Advertisments