RE: xsi:type inheritance issues

> -----Original Message-----
> From: Jeni Tennison [mailto:jeni@jenitennison.com] 
> Sent: Fri, Sep 05, 2003 03:05
> To: Razvan Costea-Barlutiu
> Cc: xmlschema-dev@w3.org
> 
> > 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?
> 
> Yes, it does. See Clause 4.3 of Validation Rule: Element Locally Valid
> (Element) at
> http://www.w3.org/TR/xmlschema-1/#section-Element-Declaration-
> Validation-Rules

4.3 hinges on the definition of "validly derived", which is given in [1].  "validly derived" allows that the basetype of the type specified in xsi:type does NOT have to be the type specified in the schema...only that there be an inheritiance chain to that type.

The original post in this thread mentioned that Spy was complaining but that xerces was not...my experience has been that Spy incorrectly requires (at least thru v5...not sure about the newly released version) the xsi:type to be "directly" derived from the type in the schema...whereas, xerces correctly walks up the inheritance hierarchy and as long as it finds the schema type in the tree somewhere then it says all is OK.

pvb

[1] http://www.w3.org/TR/xmlschema-1/#cos-ct-derived-ok

Received on Friday, 5 September 2003 11:05:37 UTC