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

Substitution Groups

From: Ian Stokes-Rees <ijs@decisionsoft.com>
Date: Thu, 24 Jan 2002 10:39:42 +0000
To: "xmlschema-dev@w3.org " <xmlschema-dev@w3.org>
Message-ID: <20020124103930.E4324@decisionsoft.com>
I am trying to make use of Substitution Groups and am having a bit of a
problem identifying if the failure I am getting from the schema below is
a result of Xerces or a result of bad syntax.

Can someone please confirm that the following is an acceptable schema
and use of substitution groups:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified"

	<xsd:complexType name="AnimalType">
		<xsd:attribute name="name" type="xsd:string" use="required"/>

	<xsd:element name="Animal" type="AnimalType" abstract="true"/>
	<xsd:element name="Cat" type="AnimalType" substitutionGroup="Animal"/>


I am tending towards the idea that Xerces has a bug wherin it fails to
identify that both Cat and Animal have the same type for the
substitution group head.  Interestingly if an intermediate type CatType
is introduced which derives from AnimalType and Cat is then of type
CatType Xerces seems to be happy with it.

Appreciate any comments on this.


Ian Stokes-Rees, Client Services      DecisionSoft Ltd.
Telephone: +44-1865-203192            http://www.decisionsoft.com
Received on Thursday, 24 January 2002 05:39:54 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:55 UTC