469,580 Members | 1,883 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,580 developers. It's quick & easy.

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

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..

Jun 5 '06 #1
2 1497
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
<ho*****@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr 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..

Jun 5 '06 #2
ho*****@gmail.com 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.)
Jun 5 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Kimmo J?rvikangas | last post: by
2 posts views Thread by nosferatu_1_1 | last post: by
3 posts views Thread by Daniel Wilson | last post: by
1 post views Thread by cedric.louyot | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.