[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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>
question about validity

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 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.