Re: Understanding anyType

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 UTC