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

Make xsi:type a list of QNames?

From: Alessandro Triglia <sandro@mclink.it>
Date: Fri, 4 Apr 2003 09:38:52 -0500
To: "[Public XML Schema-DEV]" <xmlschema-dev@w3.org>
Message-ID: <000101c2fab7$ea70b7d0$d191c044@Aldebaran>


Should it be possible to declare multiple types for elements in
instances, instead of just one, by using xsi:type?   I don't know if
this has ever been suggested.

Suppose that:

1) I define a complex type B, and a complex type X that extends it
substantially.  I declare an element E of type B.

2) Later on, I define a new schema document with a new target namespace
and a new type Y that extends type X in a minor way.

3) Some users will start creating instances where element E uses type Y
and carries an   xsi:type="Y"  attribute.

Before everybody is aware of (2) (which may never happen), there will be
applications that know type X but don't know type Y, so they will be
unable to process the element E in the instance as a Y.  Unfortunately,
they will even be unable to process the element as an X.  They can only
process it as a B.  This is a pity.

One solution would be to allow multiple types in xsi:type:

	xsi:type="nsa:X nsb:Y"

(When there are multiple types listed in the value of xsi:type, they
should be a series of T1, T2, T3, ...  where T2 is derived from T1, T3
is derived from T2, etc., not necessarily directly.  The last one should
validate the element.)

Providing multiple types in an xsi:type attribute, instead of just one,
would be up to the writer of the instance.  However, there are cases
like the above scenario, where this would be very useful for many reader

Alessandro Triglia
OSS Nokalva
Received on Friday, 4 April 2003 09:39:51 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:10 UTC