Re: Problems with xs:complexType restriction involving xs:choice

Ahhh, that makes sense. Thanks. 

Trust me to look for a complicated answer. :)

PS: I guess this means there's a bug in XSV (and XML Spy). 

-- 
THINGS TO DO IF I BECOME AN EVIL OVERLORD #71
If I decide to test a lieutenant's loyalty and see if he/she should be made
a trusted lieutenant, I will have a crack squad of marksmen standing by 
in case the answer is no.

----- Original Message ----- 
From: "Lemmin, Harald" <Harald.Lemmin@softwareag.com>
To: <xmlschema-dev@w3.org>
Sent: Wednesday, January 09, 2002 10:32 AM
Subject: RE: Problems with xs:complexType restriction involving xs:choice


> Hi,
> 
> you extend by a change in the occurrences:
> your base definition is:
> ...
> <xs:element ref="phx:Shipment" minOccurs="0"/>
> ...
> 
> but the "restricted" one is:
> ...
> <xs:element ref="phx:Shipment" maxOccurs="unbounded"/>
> ...
> 
> That means the base type permits 0..1 Shipment, whereas the restricted type
> permits 1..unbounded Shipment and that is not a valid restriction.
> 
> Rgrds,
> Harald 
> 
> -----Original Message-----
> From: Dare Obasanjo [mailto:kpako@yahoo.com]
> Sent: Mittwoch, 9. Januar 2002 22:10
> To: xmlschema-dev@w3.org
> Subject: Problems with xs:complexType restriction involving xs:choice
> 
> 
> The attached schema gives the following  error
> 
>     ERROR: Invalid particle derivation by restriction.
> 
> when validated with MSFT .NET's XmlValidatingReader but works fine with XSV
> (and XML Spy). So is there a bug in the .NET XmlValidatingReader or is the
> derivation invalid?
> 
> I assume the relevant parts of the XML Schema: Structures recommendation is
> section
> 
>     3.4.6 (Constraints on Complex Type Definition Schema Components)
> and
>     Schema Component Constraint: Particle Valid (Restriction) [0]
> and
>     Schema Component Constraint: Particle Derivation OK (Choice:Choice --
> RecurseLax) [1]
> 
> but it wasn't readily obvious if there was any problem with the schema
> _except_  if the part 2 of the (Choice:Choice -- RecurseLax) section
> mentioned
> above requires that for each particle in the Base type,B, there must be a
> corresponding particle in the Derived type, D.
> 
> [0] http://www.w3.org/TR/xmlschema-1/#cd-model-restriction
> [1] http://www.w3.org/TR/xmlschema-1/#rcase-RecurseLax
> 
> <xs:schema  xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:phx="urn:foo"
>   targetNamespace="urn:foo">
> <xs:element name="Manifest" type="xs:string" />
> <xs:element name="Shipment" type="xs:string" />
> <xs:element name="Package" type="xs:string" />
> <xs:simpleType name="CarrierSpecialService_t">
>         <xs:restriction base="xs:positiveInteger">
>          <xs:maxExclusive value="100"/>
>         </xs:restriction>
>        </xs:simpleType>
>   <xs:simpleType name="Carrier_t">
>         <xs:restriction base="xs:positiveInteger">
>          <xs:maxExclusive value="100"/>
>         </xs:restriction>
>        </xs:simpleType>
> 
> <xs:complexType name="RequestPayload_t">
>     <xs:choice maxOccurs="unbounded">
>         <xs:element ref="phx:Manifest" minOccurs="0"/>
>         <xs:element ref="phx:Shipment" minOccurs="0"/>
>         <xs:element ref="phx:Package" minOccurs="0"/>
>         <xs:element name="CarrierSpSvc" type="phx:CarrierSpecialService_t"
> minOccurs="0"/>
>         <xs:element name="Carrier" type="phx:Carrier_t" minOccurs="0"/>
>     </xs:choice>
> </xs:complexType>
> 
> <xs:complexType name="storeShipmentPayload_t">
>     <xs:complexContent>
>         <xs:restriction base="phx:RequestPayload_t">
>         <xs:choice maxOccurs="unbounded">  <! -- ERROR OCCURS HERE -->
>             <xs:element ref="phx:Shipment" maxOccurs="unbounded"/>
>         </xs:choice>
>     </xs:restriction>
> </xs:complexContent>
> </xs:complexType>
> </xs:schema>
> 
> --
> THINGS TO DO IF I BECOME AN EVIL OVERLORD #71
> If I decide to test a lieutenant's loyalty and see if he/she should be made
> a trusted lieutenant, I will have a crack squad of marksmen standing by
> in case the answer is no.
> 
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Received on Wednesday, 9 January 2002 13:41:08 UTC