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

RE: xsi:type inheritance issues

From: Biron,Paul V <Paul.V.Biron@kp.org>
Date: Fri, 5 Sep 2003 07:40:20 -0700
Message-Id: <8904C60CACA7D51191BC00805FEAAF4301895E43@crdc-exch-7.crdc.kp.org>
To: Jeni Tennison <jeni@jenitennison.com>, Razvan Costea-Barlutiu <cbrazvan@laitek.com>
Cc: xmlschema-dev@w3.org
> -----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 GMT

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