Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Chameleon includes with no targetNamespace imports

From: Kasimier Buchcik <kbuchcik@---------.-->
To: XML-SCHEMA <xmlschema-dev@--.--->
Date: 9/6/2005 7:30:00 PM
Hi,

A chameleon-include test, which checks what happens with
the components of a schema with no targetNamespace if imported
by a schema, which in turn is a chameleon include - and if
this is allowed at all.

I get positive results from both XSV and Xerces here, but
the spec seems to contradict.

I used Xerces-J 2.7.1 and XSV 2.10 for the test.

(I would like to provide results from Saxon as well, but I
don't know yet how to add Saxon to the schema validators
in my Stylus Studio.)

cham-1.xsd
----------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
	targetNamespace="urn:test:foo">
	<xs:include schemaLocation="cham-1.inc.xsd"/>
</xs:schema>

cham-1.inc.xsd
--------------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:import schemaLocation="cham-1.imp.xsd"/>
	<xs:element name="foo">
		<xs:complexType>
			<xs:sequence>
				<xs:any namespace="##local" processContents="strict"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>

cham-1.imp.xsd
--------------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="bar" type="xs:integer"/>	=09
</xs:schema>

cham-1.xml
----------
<f:foo
	xmlns:f="urn:test:foo"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="urn:test:foo cham-1.xsd">
	<bar>1</bar>
</f:foo>

Validating cham-1.xml against cham-1.xsd
----------------------------------------

This validates with Xerces and XSV.

Note that "cham-1.inc.xsd" has no targetNamespace
attribute and imports a schema with no target namespace.
This seems to violate src-import [1]:

"1.2 If the namespace [attribute] is not present, then the enclosing
<schema> must have a targetNamespace [attribute]"

Are included schemas are exempt from this constraint?

If this is allowed (which should be mentioned by the spec in this
case), then src-include 3.2 [2] should point out more clearly that
only the 'original' components of the included schema should be
"namespace-converted".
I read:

"all the =B7schema components=B7 of I, except that anywhere the =B7absent=
=B7
target namespace name would have appeared, the =B7actual value=B7 of the
targetNamespace [attribute] of SII=A2 is used"

... together with the definition of how components should 'bubble' up
to the importing/including schemas...

"The =B7schema components=B7 [...] of a schema corresponding to a <schema>
element information item with one or more <import> element information
items must include not only definitions or declarations corresponding to
the appropriate members of its [children], but also, for each of those
<import> element information items for which clause 2 above is
satisfied, a set of =B7schema components=B7 identical to all the =B7schema
components=B7 of I."

...this could lead to the assumption that the imported components
(which have an 'absent' target namespace) of the included chameleon
schema need to be converted as well.
On the other side: if the chameleon schema would _include_ another
chameleon schema, then we would convert the namespace in those
components, right? If yes, then this particular difference between
imports and includes should be made clearer.

[1] http://www.w3.org/TR/xmlschema-1/#src-import
[2] http://www.w3.org/TR/xmlschema-1/#src-include

Regards,

Kasimier

From mike@s... Tue Sep 06 16:01:50 2005
Received: from lisa.w3.org ([128.30.52.41])
	by frink.w3.org with esmtp (Exim 4.50)
	id 1ECftO-00


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent