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

Re: Understanding anyType

From: Jeni Tennison <jeni@jenitennison.com>
Date: Tue, 14 Jan 2003 16:31:44 +0000
Message-ID: <9211530630.20030114163144@jenitennison.com>
To: "Horti, Andras" <andras.horti@joanneum.at>
CC: xmlschema-dev@w3.org

Hi Andras,

> I have an understanding problem with anyType. If I have the following type:
>   <xsd:complexType name="General">
>     <xsd:complexContent>
>       <xsd:restriction base="xsd:anyType" />
>     </xsd:complexContent>
>   </xsd:complexType>
>
> and define an element with it:
>
>   <xsd:element name="SomeElement" type="General"/>
>
> Is it a general type to assign anything to it using xsi:type or it
> is always an empty element ?

The <SomeElement> element must be of the General type (empty and with
no attributes) unless it has an xsi:type attribute. If it has an
xsi:type attribute then the type named in that attribute must be a
type derived from the General type; it can be derived by restriction
(though it's impossible to restrict the General type any further) or
by extension.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Tuesday, 14 January 2003 11:32:11 GMT

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