473,398 Members | 2,389 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,398 software developers and data experts.

xml schemas - work around the min=1 max=1 in the 'all' group

Hi,

Can the following be done?

I have some elements, that can have other sub elements with mixed
content.

The sub elements can either be restricted via min=1, max=1 or min=1
max=unbounded.

The order of the sub elements is not important and will vary.

Examples of an instance are,

<foo>
<boo>bob is my uncle</boo>
<soo>64<soo>
<foo>

or

<foo>
<soo>64<soo>
<boo>bob is my uncle</boo>
<foo>

or

<foo>
<soo>64<soo>
<soo>64<soo>
<soo>64<soo>
<soo>64<soo>
<soo>64<soo>
<boo>bob is my uncle</boo>
<foo>

or

<foo>
<soo>64<soo>
<boo>bob is my uncle</boo>
<soo>64<soo>
<soo>64<soo>
<soo>64<soo>
<soo>64<soo>
<foo>

Notice how boo is bound with the restriction min=max=1
and soo is >=1!

I am pretty new to schemas, but I do believe that the only way to do
this is something like the following:

....
<xsd:element name="soo" type="xsd:int" />
<xsd:element name="boo" type="xsd:string" />

<xsd:element name="foo">
<xsd:complexType>
<xsd:choice>
<xsd:sequence>
<xsd:element ref="soo" minOccurs="1" maxOccurs="unbounded" />
<xsd:element ref="boo" minOccurs="1" maxOccurs="1" />
</xsd:sequence>
<xsd:sequence>
<xsd:element ref="boo" minOccurs="1" maxOccurs="1" />
<xsd:element ref="soo" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:choice>
</xsd:complexType>
</xsd:element>
....

Do i really have to enumerate through all of the possibilities? I hope
not, because when the number of children of foo grows (let the number
of children = n), the possibilities would be n! There has to be
something that i am missing.

Any ideas?

Thanks,

Eddie

Jul 20 '05 #1
0 1018

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

Similar topics

2
by: Boris Sargos | last post by:
Hi, I wrote the Matrix class suggested by Stroustrup in his reference book, and in this aim, wrote too the following member function, which returns the ith row of the Matrix : ...
2
by: hharry | last post by:
Hello All, I have this table: CREATE TABLE . ( IDENTITY (1, 1) NOT NULL , (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , NULL , ...
6
by: Wire | last post by:
Hello I want to sum these records on month(datum) and device and get then get the min and max values and the associated low high date/times this does not work select month(datum) as...
3
by: Ker | last post by:
I have a query that works great. It gives me the min for multiple fields. Within this query, I also need to get the max of some fields too. I currently have output of Date Name ...
5
by: Salad | last post by:
This may occur to you in the future. You want to get the min or max of a field that you set criteria on...maybe for a combo box. Let's say you wanted to get the minimum of all date fields where...
5
by: kevinjouco | last post by:
Hello Have searched the group for a solution to the following problem without success: Table 1 has Ref No (No Duplicates) & Min Max Value Fields ie Ref No 1 Min 1 Max 10 Ref No 2 Min 11 Max...
4
by: BoscoPippa | last post by:
Hi all, I'm a rank beginner to C++ and programming in general. I'm in week 6 of my first course, and we have an assignment I'm having a little trouble with. If it matters, we're using standard...
3
by: Michel Esber | last post by:
Hi all, Db2 v8 FP15 LUW . create table T (ID varchar (24), ABC timestamp) There is an index for (ID, ABC), allowing reverse Scans. My application needs to determine MIN and MAX(ABC) for a...
19
by: Eugeny Myunster | last post by:
I know, only simple one: #include <stdio.h> int main() { int min=0,max=0,i,arr; for(i=0;i<12;i++) arr=rand()%31-10; for(i=0;i<12;i++)
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.