OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xml-dev] unbounded element within an <all> tag



Hello all.

I've been going out of my mind trying to figure this one out... and I've
seen it asked elsewhere but I could not for the life of me find an
answer to it.

I just do not understand why I haven't been able to find an answer to
this question... this must be a FAQ.

My question is:

How can I define an XML Schema that defines an element which has certain
child elements and I need them all to appear but don't want to constrain
the order of the children (so far this is just <xsd:all> but here's the
twist) but I want one (or more...) of the elements to appear 0 or more
times (not constrained to only one time as the <all/> does).

Here's an example that describes what I want (only problem is that it's
illegal... so I can't have it):

<xsd:complexType name="foo">
  <xsd:all>
    <xsd:element name="bar1" type="someType"/>

    <!-- The following line produces an error because "unbounded" is not
allowed within an all tag -->
    <xsd:element name="bar2" type="someType" minOccurs="0"
maxOccurs="unbounded"/>

    <xsd:element name="bar3" type="otherType"/>
    <xsd:element name="bar4" type="thirdType"/>
  </xsd:sequence>
</xsd:complexType> 

There must be some way to do this right?  I feel very bad that I haven't
found it yet :(.

Can you please help?

Kind regards,
	Stefan Freyr

--------------------------------------------
Stefan Freyr Stefansson
Software Developer
deCODE Genetics, Inc.
http://www.decode.com

Phone: (+354) 570 2854
GSM:   (+354) 861 1718
Fax:   (+354) 491 3782
BEGIN:VCARD
VERSION:2.1
N;ENCODING=QUOTED-PRINTABLE:;=01
REV:20001030T115142Z
END:VCARD