P
Peter Theill
Hi,
I'm trying to build an element which will allow Xml such as:
<location type="home">
<AddressLine1>xyz</AddressLine1>
</location>
<location type="work url">
<Url>http://xyz/</Url>
</location>
The content of the location node should allow anything so I'm trying to use
xsd:anyType. I've defined this complex type:
<xsd:complexType name="location">
<xsd:complexContent>
<xsd:extension base="xsd:anyType">
<xsd:attribute name="type" type="xsd:string" use="required" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
However my schema validator (XmlSchemaSet class of the .NET 2.0 frameworK)
can't validate and tells me "The derived type and the base type must have
the same content type.". What do I miss?
I'm trying to build an element which will allow Xml such as:
<location type="home">
<AddressLine1>xyz</AddressLine1>
</location>
<location type="work url">
<Url>http://xyz/</Url>
</location>
The content of the location node should allow anything so I'm trying to use
xsd:anyType. I've defined this complex type:
<xsd:complexType name="location">
<xsd:complexContent>
<xsd:extension base="xsd:anyType">
<xsd:attribute name="type" type="xsd:string" use="required" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
However my schema validator (XmlSchemaSet class of the .NET 2.0 frameworK)
can't validate and tells me "The derived type and the base type must have
the same content type.". What do I miss?