W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2003

xsi:type inheritance issues

From: Razvan Costea-Barlutiu <cbrazvan@laitek.com>
Date: Thu, 04 Sep 2003 11:41:53 +0200
Message-Id: <5.2.0.9.0.20030904111855.00baf068@mail.laitek.com>
To: xmlschema-dev@w3.org

All--

I have a huge problem with xsi:type, as seen by various parsers. I can't 
tell which of the parsers are right or wrong as I see suporters for both, 
arguing that one or the other is right.

Namely:

When using xsi:type in an XML instance, does the specified type HAS to be 
derived from the original type of the element it modifies or not?

XMLSpy complains if the replacing type is not derived from the original 
type. Xerces does not. Is there a flavor to this?

If the schema does not specify a type for the element, can that type be 
replaced by just about anything? E.G:

Schema:
<xs:element name="sample">;
<xs:complexType name="replacement">
	<xs:extension base="someOtherType">... etc
</xs:complexType>

Instance:
<sample xsi:type="replacement">

Is the above a valid construction? Again, XMLSpy (from 4.3 to 5.0) 
complains that the "replacement" is not derived from the original type of 
"sample". Xerces says it's aok.

Any help is hugely appreciated.
Best regards,
--Razvan Costea Barlutiu

Light Soft.
Received on Friday, 5 September 2003 04:50:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:39 GMT