W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2004

Another question of validity

From: Farber, Saul (ENV) <Saul.Farber@state.ma.us>
Date: Tue, 9 Nov 2004 16:59:42 -0500
Message-Id: <A70E4F6720A7254CBEF287061EBAFC79E310E8@ES-MSG-008.es.govt.state.ma.us>
To: <xmlschema-dev@w3.org>

Hey all,

After that last question about legal derivations, I came up with another
case where Xerces complains of invalid restriction, but I can't seem to
figure out why.  Here's the sample schema:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.test.com/test"
xmlns:test="http://www.test.com/test">
	<complexType name="basicBitType" abstract="true">
		<sequence>
			<element name="testElement" type="token"
maxOccurs="unbounded"/>
		</sequence>
	</complexType>
	<complexType name="restrictedBasicBitType">
		<complexContent>
			<restriction base="test:basicBitType">
				<sequence>
					<element name="testElement"
type="token" maxOccurs="100"/>
				</sequence>
			</restriction>
		</complexContent>
	</complexType>
	<element name="basicBit" type="test:basicBitType"
abstract="true"/>
	<element name="restrictedBasicBit"
type="test:restrictedBasicBitType" substitutionGroup="test:basicBit"/>
	<complexType name="basicBitContainerType">
		<sequence>
			<element ref="test:basicBit"/>
		</sequence>
	</complexType>
	<complexType name="restrictedBasicBitContainerType">
		<complexContent>
			<restriction base="test:basicBitContainerType">
				<sequence>
					<element
ref="test:restrictedBasicBit"/>
				</sequence>
			</restriction>
		</complexContent>
	</complexType>
	<!-- this part makes it fail! -->
	<complexType name="superRestrictedBasicBitType">
		<complexContent>
			<restriction base="test:restrictedBasicBitType">
				<sequence>
					<element name="testElement"
type="token"/>
				</sequence>
			</restriction>
		</complexContent>
	</complexType>
	<element name="superRestrictedBasicBit"
type="test:superRestrictedBasicBitType"
substitutionGroup="test:restrictedBasicBit"/>
</schema>


If I remove the last two definitions
(complexType:superRestrictedBasicBitType and
element:suerRestrictedBasicBit) then this schema validates.  But adding
them to the schema seems to make Xerces choke.

Since the restriction in superRestrictedBasicBitType is a valid
restriction with respect to both restrictedBasicBitType and
basicBitType, why would adding it to the substitutiongroup of
restrictedBasicBit make any difference?  Is Xerces simply not checking
the other substitutionGroups for validity?  Or is this really invalid?

Thanks again for the help!

--saul


GIS Web Services
MassGIS - Executive Office of Environmental Affairs

251 Causeway Street
5th Floor
Boston, MA  02114
617-626-1145 
Received on Tuesday, 9 November 2004 22:04:36 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 23:40:23 UTC