W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2002

Substitution group and abstract element

From: Piccand Régis <regis.piccand@imtf.ch>
Date: Tue, 12 Feb 2002 09:50:42 +0100
Message-ID: <DF7EC83D7AFBD411965B0008C7596EC53ED57F@imtfexchange.imtf.ch>
To: " 'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
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:element ref="contentType"/>
	<xs:element name="textContent" type="xs:string"
	<xs:element name="base64Content" type="xs:base64Binary"
	<xs:element name="contentType" abstract="true"/>

The instance document : 

<rootElt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	<contentType xsi:type="textContent"></contentType>

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.

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:59 UTC