xsi:type inheritance issues

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 UTC