[standards-jig] sequence vs. choice

Fabrice DESRE fabrice.desre at francetelecom.com
Thu Feb 7 08:36:56 UTC 2002


> Peter Saint-Andre wrote:

> XML schemas question: can do the following to override the maxOccurs
> on
> the <xsd:choice/> element?
> 
>      <xsd:choice minOccurs='0' maxOccurs='1'>
>        <xsd:element ref='body' />
>        <xsd:element ref='subject' />
>        <xsd:element ref='thread' />
>        <xsd:any namespace='##any' minOccurs='0' maxOccurs='unbounded'
> />
>        <xsd:element ref='error' />
>      </xsd:choice>

 Not the way you intend I think. The above schema allows anything inside
the <message/> element, just because of
<xsd:any namespace='##any' minOccurs='0' maxOccurs='unbounded'/>
My understanding is that we want allow any element that a local name
value of 'x', in any namespace. Am I wrong ?

 Moreover, this schema doesn't allow a <message/> to contain both
a <body/> and a <subject/> !!

 I'll try to come up with something for the message schema and I'll post
it there.

	Fabrice
-- 
Fabrice Desré - France Telecom R&D/DTL/MSV
Tel: +(33) 2 96 05 31 43
Fax: +(33) 2 96 05 39 45



More information about the Standards mailing list