Re: list of union-types - simple problem?

> Simon.Cox@csiro.au wrote...
> 
> I'm having a problem with a list type whose items are a union.  
> Here's a test schema: 
> 
> <xs:schema targetNamespace="http://www.ned.dem.csiro.au/XMML"
> xmlns:xmml="http://www.ned.dem.csiro.au/XMML"
> xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
> attributeFormDefault="unqualified">
>   <!-- enumerated simpleType -->
>   <xs:simpleType name="NullType">
>     <xs:restriction base="xs:string">
>       <xs:enumeration value="inapplicable"/>
>       <xs:enumeration value="unknown"/>
>       <xs:enumeration value="unavailable"/>
>       <xs:enumeration value="missing"/>
>     </xs:restriction>
>   </xs:simpleType>
>   <!-- union simpleType -->
>   <xs:simpleType name="doubleOrNull">
>     <xs:union memberTypes="xmml:NullType xs:double"/>
>   </xs:simpleType>
>   <!-- list simpleType -->
>   <xs:simpleType name="QuantityListType">
>     <xs:list itemType="xmml:doubleOrNull"/>
>   </xs:simpleType>
>   <!-- element -->
>   <xs:element name="quantityList" type="xmml:QuantityListType"/>
> </xs:schema>
> 
> and here's a simple instance:
> 
> <quantityList xmlns="http://www.ned.dem.csiro.au/XMML"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.ned.dem.csiro.au/XMML ./listTest.xsd">0.86
> 0.86 missing</quantityList>
> 
> Spy says "Invalid value for datatype list of union of string, double in
> element 'quantityList'".  
> 
> Why invalid??

The schema/instance file both looks valid. And Xerces2Beta4 AWA latest Xerces 
extract from CVS seems happy with these files.

Cheers,
Rahul.

> 
> _____
> 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
> 


Sun Microsystems, Inc.

Received on Friday, 25 January 2002 07:12:30 UTC