Substitution group and abstract element

Hi all,

I am using a substitution group where the "head" element is abstract.

In the instance document, I use the xsi:type to specify the type to use.
However, it looks like the validator doesn't accept the types in the
substitution group.

the schema :

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:element name="rootElt">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="contentType"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="textContent" type="xs:string"
substitutionGroup="contentType"/>
	<xs:element name="base64Content" type="xs:base64Binary"
substitutionGroup="contentType"/>
	<xs:element name="contentType" abstract="true"/>
</xs:schema>


The instance document : 

<rootElt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="C:\Temp\Untitled10.xsd">
	<contentType xsi:type="textContent"></contentType>
</rootElt>

Error (XML Spy 4.3) : This file is not valid : Schema error - element or
complexType 'contentType' is declared as abstract='true' ; please use
xsi:type to specify a derived type that is not abstract, or use a member of
a substitutionGroup instead.

Am I doing something wrong here ?

Thanks in advance for your help.

Régis

Received on Tuesday, 12 February 2002 03:57:48 UTC