473,396 Members | 1,945 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,396 software developers and data experts.

Multiple definition of element in xs:choice element

Hajo,

I know only one way of forcing element to have one or more childes:

<xs:element name="saleOrSupplyMethod"> <BR/>
<xs:complexType>
<xs:choice>
<xs:sequence>
<xs:element name="generalSale" type="emptyTagType" />
<xs:element name="prescription" type="emptyTagType"/>
<xs:element name="retailSale" type="emptyTagType" />
</xs:sequence>
<xs:sequence>
<xs:element name="generalSale" type="emptyTagType" />
<xs:element name="retailSale" type="emptyTagType" />
</xs:sequence>
etc.....
</xs:choice>
</xs:complexType>
</xs:element>

But going this way I get following error:

Multiple definition of element 'generalSale' causes the content model
to become ambiguous. A content model must be formed such that during
validation of an element information item sequence, the particle
contained directly, indirectly or implicitly therein with which to
attempt to validate each item in the sequence in turn can be uniquely
determined without examining the content or attributes of that item,
and without any information about the items in the remainder of the
sequence.

thnaks in advance for any info

Pawel Pabich

Nov 15 '05 #1
2 5622
<xs:element name="saleOrSupplyMethod"> <BR/>
<xs:complexType>
<xs:sequence>
<xs:element name="generalSale" type="emptyTagType" />
<xs:element name="prescription" type="emptyTagType"
minOccurs="0" />
<xs:element name="retailSale" type="emptyTagType" />
</xs:sequence>
</xs:complexType>
</xs:element>

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

<pa**********@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Hajo,

I know only one way of forcing element to have one or more childes:

<xs:element name="saleOrSupplyMethod"> <BR/>
<xs:complexType>
<xs:choice>
<xs:sequence>
<xs:element name="generalSale" type="emptyTagType" />
<xs:element name="prescription" type="emptyTagType"/>
<xs:element name="retailSale" type="emptyTagType" />
</xs:sequence>
<xs:sequence>
<xs:element name="generalSale" type="emptyTagType" />
<xs:element name="retailSale" type="emptyTagType" />
</xs:sequence>
etc.....
</xs:choice>
</xs:complexType>
</xs:element>

But going this way I get following error:

Multiple definition of element 'generalSale' causes the content model
to become ambiguous. A content model must be formed such that during
validation of an element information item sequence, the particle
contained directly, indirectly or implicitly therein with which to
attempt to validate each item in the sequence in turn can be uniquely
determined without examining the content or attributes of that item,
and without any information about the items in the remainder of the
sequence.

thnaks in advance for any info

Pawel Pabich

Nov 15 '05 #2
Thanks for replay. But I think I wasn't precise enough. I have to
ensure that all possible combinations are allowed. And your solution
does not allow me to have only one element, lets say generalSale. Here
I have prepared one more example. In short I have to ensure that at
least one elemnet is chosen and I have a set of 2 elements.

<xs:element name="tempElement">
<xs:complexType>
<xs:choice>
<xs:sequence>
<xs:element name="elem1" type="xs:string" />
<xs:element name="elem2" type="xs:string" />
</xs:sequence>
<xs:sequence>
<xs:element name="elem1" type="xs:string" />
</xs:sequence>
<xs:sequence>
<xs:element name="elem2" type="xs:string" />
</xs:sequence>
</xs:choice>
</xs:complexType>
</xs:element>

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mohammed Mazid | last post by:
Can anyone please give me some clues on how to track the right answers in multiple-choice type questions (using checkbox) and single-choice questions (rdio buttons) and also how to store the right...
3
by: dgaucher | last post by:
Hi, I want to consume a Web Service that returns a choice, but my C++ client always receives the same returned type. On the other hand, when I am using a Java client, it is working fine (of...
2
by: Matthew | last post by:
I have implemented the xmlSchemaCollection object to cache commonly used schemas, as follows: =============================================================================== public void...
1
by: raiya | last post by:
hi, I'm a teacher and new ms access user. I'm intending to design an ms access db to post multiple choice questions each with 4 choices. I created 2 tables one for the questions and the other for the...
1
by: carly | last post by:
hi, i've been solving these multiple choice questions, and i'd like to know if what i answered is right ot wrong......... just to double check :) I) Consider the code given below. ...
0
by: Night Air | last post by:
I have problem with a website that collects user responses to multiple choice questions. The users choose and value from a Radio Button, then click on a Next button to go the next page. The...
1
by: mcr29 | last post by:
I've been asked to build a survey database. The survey is to be dynamic, allowing any number of questions to be part of the current survey. So I've got a Survey table with SurveyDetail, and a...
1
by: Brian Byrne | last post by:
Hi , Does anybody know where there is a good bank of C++ multiple choice questions covering all the essentials. I need to brush up on the basics and multiple choice is the ideal way !? ...
1
by: zonsh | last post by:
Hi there, I am looking everywhere to find a solution where I can add a type in xml schema that will restrict the xml author to select multiple options from a list without repeating 1 option more...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.