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

Potential flaw in component reference resolution in Xerces-J

From: Kasimier Buchcik <K.Buchcik@4commerce.de>
Date: Wed, 14 Sep 2005 18:52:02 +0200
To: XML-SCHEMA <xmlschema-dev@w3.org>
Message-Id: <1126716722.1272.80.camel@librax>
component resolution

Hi,

this is a pedantic report about a potantial flaw in the
component reference resolution mechanism of Xerces-J 2.7.1.

We have a self-redefining schema itself here, which should
lead to a circularity error. However, Xerces reports a
component resolution error.

redef-group-2.xsd
-----------------
xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	targetNamespace="urn:test:foo"
	xmlns:f="urn:test:foo">

	<xsd:include schemaLocation="redef-group-2.inc.xsd"/>

	<xsd:element name="foo">
		<xsd:complexType>
			<xsd:group ref="f:thisGroup"/>
		</xsd:complexType>
	</xsd:element>

</xsd:schema>

redef-group-2.inc.xsd
---------------------
<xsd:schema
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	targetNamespace="urn:test:foo">

	<xsd:redefine schemaLocation="redef-group-2.inc.xsd">
		<xsd:group name="thisGroup">
			<xsd:sequence>
				<xsd:element name="bar"/>
			</xsd:sequence>
		</xsd:group>
	</xsd:redefine>		

</xsd:schema>

redef-group-2.xml
-----------------
<foo xmlns="urn:test:foo"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="urn:test:foo redef-group-2.xsd"/>

Xerces reports:

redef-group-2.inc.xsd:7,31: (Error) src-resolve: Cannot resolve the name
',thisGroup_fn3dktizrknc9pi_fn3dktizrknc9pi' to a(n) 'group' component.

redef-group-2.inc.xsd:7,31: (Error) src-redefine.6.2.1: No group in the
redefined schema has a name matching 'thisGroup'.

redef-group.xml:4,55: (Error) cvc-complex-type.2.4.b: The content of
element 'foo' is not complete. One of '{bar}' is expected.


Regards,

Kasimier
Received on Wednesday, 14 September 2005 16:52:11 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.