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