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

Re: Substitution Groups

From: Rahul Srivastava <Rahul.Srivastava@Sun.COM>
Date: Thu, 24 Jan 2002 18:52:56 +0000 (Asia/Calcutta)
Message-Id: <200201241328.g0ODS5F12238@blr-root.India.Sun.COM>
To: xmlschema-dev@w3.org
Cc: ijs@decisionsoft.com
> Ian Stokes-Rees wrote...
> 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>

This schema looks fine.

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

Sounds interesting. I tested your example with Xerces2Beta4 and also with the 
latest build from CVS. Somehow, I could not generate any error. Could you also 
post your instance file. BTW, which version of xerces are you using?.


> 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 08:28:11 UTC

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