xsi:type in a complex type derived from an union

    Hello all,

I wish to derive a simple type by extension to add an attribute. This
simple type is itself a union.

My question is : can I override the element type in the instance with
the "xsi:type" attribute ?

Example:
Schema
 <xsd:element name="anElement">
  <xsd:complexType>
   <xsd:simpleContent>
    <xsd:extension base="intOrString">
     <xsd:attribute name="anAttribute" type="xsd:int"/>
    </xsd:extension>
   </xsd:simpleContent>
  </xsd:complexType>
 </xsd:element>

 <xsd:simpleType name="intOrString">
  <xsd:union memberTypes="xsd:int xsd:string"/>
 </xsd:simpleType>

Instance:
 <anElement anAttribute="1" xsi:type="string">
    something
 </anElement>
 <!-- Is the "xsi:type" attribute legal ? -->


Thank you,

    Sylvain

---------------------------------------------------------
Sylvain Devillers, Senior Scientist
Laboratoires d'Electronique Philips (LEP)
Postal address until 26/06:
22, avenue Descartes, F-94453 Limeil-Brevannes, France
+33 (0)1 45 10 67 55
Sylvain.Devillers@philips.com
---------------------------------------------------------

Received on Monday, 11 June 2001 11:57:46 UTC