This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4078 - addB156 - schemaLocation after first use of namespace
Summary: addB156 - schemaLocation after first use of namespace
Status: RESOLVED FIXED
Alias: None
Product: XML Schema Test Suite
Classification: Unclassified
Component: Microsoft tests (show other bugs)
Version: 2006-11-06
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Henry S. Thompson
QA Contact: XML Schema Test Suite mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 4123
  Show dependency treegraph
 
Reported: 2006-12-13 18:04 UTC by Michael Kay
Modified: 2010-07-09 12:42 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2006-12-13 18:04:02 UTC
In the Microsoft Additional test set, test group addB156 uses the instance document test93490_2.xml, which contains the structure:

<foo:root 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:schemaLocation="foo test93490_1.xsd" 	
	xmlns:foo="foo"
>

<foo:elem1 xsi:schemaLocation="foo test93490_2.xsd" xmlns:foo="foo"/>
<foo:elem2 />
<foo:elem3 />

</foo:root>

As it happens, validation of the instance does not require any schema components from test93490_2.xsd.

The test results document this as invalid, presumably on the basis of the rule in 4.3.2 rule 4: "xsi:schemaLocation and xsi:noNamespaceSchemaLocation [attributes] can occur on any element. However, it is an error if such an attribute occurs after the first appearance of an element or attribute information item within an element information item initially ·validated· whose [namespace name] it addresses. "

However, Schema Representation Constraint: Schema Document Location Strategy says:

Given a namespace name (or none) and (optionally) a URI reference from xsi:schemaLocation or xsi:noNamespaceSchemaLocation, schema-aware processors may implement any combination of the following strategies, in any order:
1 Do nothing, for instance because a schema containing components for the given namespace name is already known to be available...

A processor that follows this strategy will not report the error described in the earlier section.

The specification appears to be internally inconsistent, and as a result this test is not interoperable. (One could finesse the inconstency by deducing that the spec says it's an error, and the spec also says that a processor isn't required to do anything about the error; but the conclusion is the same.)
Comment 1 Michael Kay 2006-12-13 18:06:59 UTC
Also applies to addB158
Comment 2 Zafar Abbas 2007-01-23 02:09:24 UTC
The spec seems to be in conflict but I think the guidance in 4.3.2 rule 4 makes more sense. Referencing an already validated namespace via such a schema location may change the meaning of an already validated element or attribute. The WG should clarfy.
Comment 3 David Ezell 2010-02-26 17:10:20 UTC
WG decided

HT to create a bug against 1.0.
For addB156 and addB158, mark as stable and 1.0 only.
Create copies of each, mark as valid, and 1.1 only.
Comment 4 Henry S. Thompson 2010-02-26 18:12:23 UTC
Per the above I've added issue 9158 against the 1.0 spec.
Comment 5 Henry S. Thompson 2010-04-05 17:22:19 UTC
made stable-valid 1.1-only copy, original marked as stable, per WG instructions
Comment 6 Michael Kay 2010-07-09 12:42:33 UTC
It appears that tests addB159, addB162, and addB166 follow the same pattern, and they too become valid in XSD 1.1 under the same reasoning. I have marked them as queried under this bug entry.

(It would be nice if this reasoning were more clearly explained in bug #9158. That bug entry refers to the "summary of changes" in XSD 1.1, which asserts that the logic of schema composition has changed, but does not really say precisely what change affects these tests.)