[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Substitution groups
- From: Ben Ryan <b_ryan@c-elect.co.uk>
- To: xml-dev@lists.xml.org
- Date: Fri, 15 Jun 2001 10:27:12 +0100
Hi,
I am trying to a schema where I want to model addresses that can handle
both UK and US style codes e.g. postcode and zip code. I wanted to use
substitution groups as follows:
<xsd:element name="code" type="astring" abstract="true">
</xsd:element>
<xsd:element name="postcode" type="astring" substitutionGroup="code">
</xsd:element>
<xsd:element name="zip" type="astring" substitutionGroup="code">
</xsd:element>
where the complex type astring is defined as follows:
<xsd:complexType name="astring" mixed="true">
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:any namespace="##other"/>
</xsd:sequence>
</xsd:complexType>
Using XMLSpy this validates OK, but using the IBM Schema Quality Checker
I get the following errors:
SUBSTITUTION GROUP ERROR : the type of the element declaration,element
postcode, is not compatible with the type of its substitution group
head.
SUBSTITUTION GROUP ERROR : the type of the element declaration,element
zip, is not compatible with the type of its substitution group head.
Can anyone explain this as I assumed :) that as they all are the same
type there should be no problem.
Thanks,
Ben
--
***************************
Dr Benjamin Ryan
Senior Technical Consultant
C-Elect
Tel: +(44) 1484 517077
Fax: +(44) 1484 517068
***************************