W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2002

RE: Need help with any and all

From: Brenda Bell <bbell@juicesoftware.com>
Date: Mon, 25 Feb 2002 14:54:20 -0500
Message-ID: <846B0B02E1B78B49B678EDCC00EB29627467C7@mail01.ent.juice.com>
To: "'Jeni Tennison'" <jeni@jenitennison.com>
Cc: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Hmmmm... XMLSpy may have a bug that let's me do this.  Either way, I decided
to go with the extra element -- I believe it's a much cleaner approach for
this particular problem.

-----Original Message-----
From: Jeni Tennison [mailto:jeni@jenitennison.com]
Sent: Monday, February 25, 2002 2:41 PM
To: Brenda Bell
Cc: 'xmlschema-dev@w3.org'
Subject: Re: Need help with any and all


Hi Brenda,

> I actually found another option (perseverence is key :):
>
> <xs:group name="baseGroup">
>   <xs:all>
>     <xs:element name="A" type="xs:string" minOccurs="1"
>                                           maxOccurs="1"/>
>     <xs:element name="B" type="xs:string" minOccurs="1"
>                                           maxOccurs="1"/>
>     <xs:element name="C" type="xs:string" minOccurs="1"
>                                           maxOccurs="1"/>
>   </xs:all>
> </xs:group >
>
> <xs:complexType name="extendedType">
>   <xs:sequence>
>     <xs:group ref="tns:baseGroup"/>
>     <xs:any namespace="##other" minOccurs="0"
>             maxOccurs="unbounded" processContents="skip"/>
>   </xs:sequence>
> </xs:complexType>
        
Hmm... I don't think that this is legal; I think that the only place
that you can refer to a model group definition whose model group is an
all group is directly from a complex type definition. Testing with
Xerces-C++ confirms this, though I can't put my finger on the place in
the Rec where it's stated.

Certainly, this ties in with the fact that you can't define an xs:all
directly within a xs:sequence -- model group definitions are supposed
to just give names to model groups so that you can reuse them, not
allow you to do things that you can't do otherwise.

Hopefully Henry or someone will be able to point to the relevant
constraint in the Rec...

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Monday, 25 February 2002 14:54:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:27 GMT