473,480 Members | 1,506 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

XSD defining repeating elements

I'm not sure if I can explain my issue well enough, but here goes:

I want to define an .XSD such that it allows for an ( A | B )*
configuration where A and B are different elements. I would like to
allow for an infinite list of either type A or type B elements. I
could accomplish this in a DTD file, but I would like to migrate to XSD
and I'm having difficulty with this aspect of it. I thought an
<xs:sequence><xs:choice>... nest might do the trick, but it's not
working and I'm not even sure if this is legal syntax.

Thanks for any help you can give me.

Sep 25 '06 #1
3 4638
It sounds like what you're looking for is

<xsd:choice minOccurs="0" maxOccurs="unbounded... </xsd:choice>

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Sep 25 '06 #2
That was exactly what I was looking for. Thanks.

Joseph Kesselman wrote:
It sounds like what you're looking for is

<xsd:choice minOccurs="0" maxOccurs="unbounded... </xsd:choice>

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Sep 25 '06 #3
"Seago" <se****@gmail.comwrites:
I'm not sure if I can explain my issue well enough, but here goes:

I want to define an .XSD such that it allows for an ( A | B )*
configuration where A and B are different elements. I would like to
allow for an infinite list of either type A or type B elements. I
could accomplish this in a DTD file, but I would like to migrate to XSD
and I'm having difficulty with this aspect of it. I thought an
<xs:sequence><xs:choice>... nest might do the trick, but it's not
working and I'm not even sure if this is legal syntax.

Thanks for any help you can give me.
Er, what's wrong with

<xsd:choice maxOccurs="unbounded">
<xsd:element ref="A"/>
<xsd:element ref="B"/>
</xsd:choice>

(which is a very simple literal translation of your example)?

(In general, if you are having trouble getting something to
work and are asking others for help, it's a good idea to
show more fully what you have tried, and to describe more fully
what error messages it elicited. See [1] for a useful essay
on the art of asking good questions.)

--C. M. Sperberg-McQueen
World Wide Web Consortium

[1] http://www.catb.org/~esr/faqs/smart-questions.html

Sep 25 '06 #4

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

Similar topics

7
3026
by: Harry Pehkonen | last post by:
I have been defining new class methods when I'm trying to simplify some code. But I'm thinking I should just define functions within that method because they aren't useful from the outside anyway....
6
2003
by: Jani Yusef | last post by:
I have a HW problem stated as shown at the top of the solution. The thing is is that I am not 100% sure wtf constant memory means. Well, I think I do but I am confused. Does my solution use contant...
1
2198
by: Wolfgang Lipp | last post by:
my question is: do we need container elements for repeating elements in data-centric xml documents? or is it for some reason very advisable to introduce containers in xml documents even where not...
11
4120
by: Christoph Boget | last post by:
When building a form using Infopath, you can define a repeating section and stick form fields in that section. I'm curious if ASP.NET has a similar control to make it easy to design something...
38
2058
by: Steven Bethard | last post by:
> >>> aList = > >>> it = iter(aList) > >>> zip(it, it) > > That behavior is currently an accident. >http://sourceforge.net/tracker/?group_id=5470&atid=105470&func=detail&aid=1121416
2
6598
by: nickheppleston | last post by:
I'm trying to iterate through repeating elements to extract data using libxml2 but I'm having zero luck - any help would be appreciated. My XML source is similar to the following - I'm trying to...
2
1588
by: Griff | last post by:
I want to display a repeating set of formatted infomation that appears within a "box" so that the individual boxes appear to the right of the previous one until the line is filled and then the next...
26
2495
by: Cliff Williams | last post by:
Can someone explain the pros/cons of these different ways of creating a class? // 1 function myclass() { this.foo1 = function() {...} } // 2a
1
3090
by: Bruce | last post by:
I have a form with repeating section using wForms (http://www.formassembly.com/blog/?p=5). I need help with the PHP to process and display multiple repeating elements if requested. PHP should send...
0
7044
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
7087
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...
1
6741
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
6944
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
5341
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,...
1
4782
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2985
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.