473,378 Members | 1,156 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 1648
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Kimmo J?rvikangas | last post by:
Dear XML (Schema) experts, As an example I have the following schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"...
2
by: nosferatu_1_1 | last post by:
Hi, I would like to create a schema that validate the following xml: <music> <pop/> <rock/> <pop/> </music>
2
by: Json | last post by:
Ok, brand new to SQLXML 3.0 and its various issues. Heres what I'm trying to do: 1. I am trying to load xml data into an empty SQL table from my .NET console application. 2. This isn't a huge...
5
by: Jeff | last post by:
We are using .Net and the wsdl Utility to generate proxies to consume web services built using the BEA toolset. The data architects on the BEA side create XML schemas with various entities in...
2
by: mavis | last post by:
The usage of <xs:choice maxOccurs="unbounded"> When we want to define a set of elements that could be in any order and with any occurences (0-unbounded), we can use <xs:choice...
3
by: Daniel Wilson | last post by:
I am trying to read data from MS SQL Server and turn it into an XML message to send to a remote server, as follows. sfSchemaFileDiag.FilterIndex = 2 If sfSchemaFileDiag.ShowDialog =...
2
by: Aray | last post by:
I googled for it for few houres, but didn't resolve it, any hints will be thinkfull. I want to use the following XSD file to guarantee <element1is unique, but it doesn't work. The following...
1
by: cedric.louyot | last post by:
Hi, I've written a schema that looks like : <xs:schema> <xs:complexType name="myType"> <xs:sequence> <xs:element name="e1" type="T1" maxOccurs="unbounded"/> <xs:element name="e2"...
1
by: s123 | last post by:
Hi, I am using the sequence tag under the choice tag. the code part of this is : <xs:choice> <xs:sequence> <xs:element name="values" type="ValuesType" minOccurs="0"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.