Can choice appear 0 or more times?

E

Edwin Castro

Hi,

I'm trying to represent (a|b)*

My first inclination was to do it with a choice:

<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="a" type="xsd:string"/>
<xsd:element name="b" type="xsd:string"/>
</xsd:choice>

Is this legal?

I have a complexType (derivedType) derived from a different complexType
(baseType). The derivedType adds a choice element like in the example
above. I'm trying to determine if it is legal to determine if our
software has a bug or not... Thanks for any responses!
 
H

Henry S. Thompson

Edwin said:
I'm trying to represent (a|b)*

<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="a" type="xsd:string"/>
<xsd:element name="b" type="xsd:string"/>
</xsd:choice>

Is this legal?

Yes, and it means what you want.

ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: (e-mail address removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 
E

Edwin Castro

Henry said:
Yes, and it means what you want.

Thanks. I have one more question... How would I determine the number of
choices and which choices they are using XPath...?
 
H

Henry S. Thompson

Edwin said:
Thanks. I have one more question... How would I determine the number of
choices and which choices they are using XPath...?

count(a|b)

ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: (e-mail address removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,254
Members
46,849
Latest member
Fira

Latest Threads

Top