Chameleon includes and wildcard intersections

Hi,

A chameleon-include test, checking wildcard intersections.
This is a late, late follow-up of
http://lists.w3.org/Archives/Public/xmlschema-dev/2004Nov/0037.html
where I mentioned what the differences are if
namespace conversion of chameleon includes takes place
after or before wildcard intersection.

Results from Xerces and XSV differ here.

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

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

cham-2.inc.xsd
--------------
<xs:schema
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:b="urn:test:bar">

	<xs:import namespace="urn:test:bar" schemaLocation="cham-2.imp.xsd"/>

	<xs:attributeGroup name="thisAttrs">		
		<xs:attributeGroup ref="b:otherAttrs"/>
		<!-- Negation of 'absent'. -->		
		<xs:anyAttribute namespace="##other" processContents="lax"/>
	</xs:attributeGroup>

	<xs:element name="foo">
		<xs:complexType>
			<xs:attributeGroup ref="thisAttrs"/>
		</xs:complexType>
	</xs:element>
</xs:schema>

cham-2.imp.xsd
--------------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
	targetNamespace="urn:test:bar">
	<xs:attributeGroup name="otherAttrs">
		<!-- Negation of "urn:test:bar". -->
		<xs:anyAttribute namespace="##other" processContents="lax"/> 
	</xs:attributeGroup>	
</xs:schema>

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

Validation of cham-2.xml against cham-2.xsd
-------------------------------------------

XSV: no errors

Xerces:
cham-2.inc.xsd:11,63: (Error) src-attribute_group.2: The intersection of
wildcards is not expressible for attribute group 'thisAttrs'.


The wildcards involved in the intersection are:
<!-- "Not" and "urn:test:bar". -->
<xs:anyAttribute namespace="##other"/> 
<!-- "Not" and "absent". -->
<xs:anyAttribute namespace="##other"/>

The result of Xerces is backed by cos-aw-intersect 5 [1]:
"If the two are negations of different namespace names, then the
intersection is not expressible."

This assumes that the namespace conversion specified in
src-include 3.2.2 [2] was applied _prior_ to the intersection
process. The other way round, the negated absent namespace
would simply have disappeared due to cos-aw-intersect 6:

"If the one is a negation of a namespace name and the other is a
negation of ·absent·, then the one which is the negation of a
namespace name must be the value."

XSV reports the wildcard to be the following:

wildcard(not [u'urn:test:foo', None, u'urn:test:bar'])

For which I cannot find a rule; so it doesn't help
clarify the issue.

But originally I tried to find out the intended timing for
building "complete wildcards": before or after namespace-
conversion. Does someone know?

This is an issue which gives me a headache for a long time;
Libxml2 still behaves like Xerces, and I got the
impression we don't work correct here, since the responses
to questions about _when_ namespace-conversion should occur,
seemed to condense to "build the schema first, then convert
the namespaces".

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

Regards,

Kasimier

Received on Tuesday, 6 September 2005 16:37:50 UTC