RE: Restricting a substitution group using <choice>

OK - at least I can see why it was rejected now.  
The issue is that a single choice is being "restricted" to a sequence of two
choices. 
 
Like you say, any valid ValueRangeType instance is truly a valid
ValueCollectionType instance, so it /should/ be possible to restrict the
latter to get the former.  
But even though this definitely follows the "spirit" of the spec, it might
fall fowl of the letter.  
Thats a shame.  

Is this something to be suggested to w3c-xml-schema-wg in some form?

_____
[This mail represents part of a discussion of work in progress 
and should not be used for any purpose without my permission.] 
_____
Simon.Cox@csiro.au  CSIRO Exploration & Mining
26 Dick Perry Avenue, Kensington WA 6151
PO Box 1130, Bentley WA 6102  AUSTRALIA
T: +61 (8) 6436 8639  F: +61 (8) 6436 8555  C: +61 (4) 0330 2672
http://www.csiro.au/page.asp?type=resume&id=CoxSimon

> -----Original Message-----
> From: Jeni Tennison [mailto:jeni@jenitennison.com]
> Sent: Friday, 15 March 2002 5:54 PM
> To: Simon.Cox@csiro.au
> Cc: dareo@microsoft.com; xmlschema-dev@w3.org
> Subject: Re: Restricting a substitution group using <choice>
> 
> 
> Hi Simon,
> 
> > But not all of them: here is another example that seems to me
> > /should/ work but MSXML just will not pass - I use a <sequence> of
> > two <choice> groups to restrict a substitution group whose
> > maxOccurs="unbounded". MSXML insists "Invalid particle derivation by
> > restriction".
> 
> The relevant types are:
> 
> >   <xs:complexType name="ValueCollectionType">
> >     <xs:sequence>
> >       <xs:element ref="my:valueMember" minOccurs="0" 
> maxOccurs="unbounded"/>
> >     </xs:sequence>
> >   </xs:complexType>
> > <!-- -->
> >   <xs:complexType name="ValueRangeType">
> >     <xs:complexContent>
> >       <xs:restriction base="my:ValueCollectionType">
> >         <xs:sequence>
> >           <xs:choice>
> >             <xs:element ref="my:lowerExclusive"/>
> >             <xs:element ref="my:lowerInclusive"/>
> >           </xs:choice>
> >           <xs:choice>
> >             <xs:element ref="my:upperInclusive"/>
> >             <xs:element ref="my:upperExclusive"/>
> >           </xs:choice>
> >         </xs:sequence>
> >       </xs:restriction>
> >     </xs:complexContent>
> >   </xs:complexType>
> 
> The content model of the first type is mapped to:
> 
>   <xs:sequence>
>     <xs:choice minOccurs="0" maxOccurs="unbounded">
>       <xs:element ref="my:valueMember" />
>       <xs:element ref="my:lowerExclusive" />
>       <xs:element ref="my:lowerInclusive" />
>       <xs:element ref="my:upperInclusive" />
>       <xs:element ref="my:upperExclusive" />
>     </xs:choice>
>   </xs:sequence>
> 
> I can't find a route through the Particle Valid (Restriction) rules at
> http://www.w3.org/TR/xmlschema-1/#cos-particle-restrict that enables
> you to restrict one choice into two choices, though I'd love to be
> corrected because intuitively it seems like something you should be
> able to do. I also can't find a way around it right now.
> 
> For the record, Xerces-C++ accepts the schema, but Xerces-J complains
> that there's no functional mapping between the components under the
> rcase-MapAndSum.1 rule (which at least tells you what the 
> problem is!).
> 
> Cheers,
> 
> Jeni
> 
> ---
> Jeni Tennison
> http://www.jenitennison.com/
> 

Received on Monday, 18 March 2002 06:23:11 UTC