W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2005

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>

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

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