Substitution Groups

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"
  targetNamespace="http://www.ara.com/animals"
  xmlns="http://www.ara.com/animals"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">

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

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

</xsd:schema>

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.

-- 
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