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

Re: Substitution Groups

From: Ian Stokes-Rees <ijs@decisionsoft.com>
Date: Thu, 24 Jan 2002 14:03:33 +0000
To: Rahul Srivastava <Rahul.Srivastava@Sun.COM>
Cc: xmlschema-dev@w3.org
Message-ID: <20020124140321.J4324@decisionsoft.com>
On Thu, Jan 24, 2002 at 06:52:56PM +0000, Rahul Srivastava wrote:
> > 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?.

I should have mentioned that I am using XercesJ-1.4.3.  I am aware that
development on this is closed, however we have systems in place which
are already using this, so I want to establish if it is a bona fide
XercesJ-1 problem as opposed to some obscure aspect of XSDL.

Here is an instance file:

<?xml version="1.0"?>
<Cat xmlns="http://www.ara.com/animals" name="Fluffy"/>

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

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:26 GMT