W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2001

xsi:type in a complex type derived from an union

From: <sylvain.devillers@philips.com>
Date: Mon, 11 Jun 2001 18:11:11 +0200
To: <xmlschema-dev@w3.org>
Message-ID: <0056900018477636000002L062*@MHS>
    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 ?

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

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

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

Thank you,


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
Received on Monday, 11 June 2001 11:57:46 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:52 UTC