Cross-references among included schema documents

If schema document A includes schema documents B and C, can a QName
appearing in B resolve to a component defined in C?

Xerces and XSV appear to allow it.

The definition of QName resolution in 3.15.3 appears to disallow it. Rule 1
says that the QName can only resolve to a component that "is a member of the
value of the appropriate property of the schema which corresponds to the
schema document within which the .QName. appears".

The schema document in which the QName appears is B. What is "the schema
which corresponds to the schema document" B? If this is the same as the
schema corresponding to the schema document A, then I can see how Xerces and
XSV are correct. 

But section 4.2.1, describing xs:include, says that the "XML Schema"
corresponding to A includes all the components of all the XML Schemas
corresponding to any <include>d schema documents. By implication, there is
an "XML Schema" correponding specifically to B. Assuming "XML Schema" as
used in section 4.2.1 means the same thing as "schema" used in 3.15.3, this
implies that there is a schema corresponding specifically to the schema
document B, which contains only those components defined in B, and therefore
that the component we are looking for (which is defined in C) is not "a
member of the appropriate property of the schema corresponding to" B.
Therefore, the QName appearing in B cannot resolve to the component defined
in C.

Once again, I'm sure Henry will point me to the magic bit of text that I
have missed. I'm looking for evidence that "XML Schema" and "schema" mean
different things, but I can't find it.

Alternatively, I'm looking for clues in the sentence (in 4.2.1) "During
schema construction, implementations must retain .QName. values for such
references [references that fail to resolve], in case an appropriately-named
component becomes available to discharge the reference by the time it is
actually needed." But generally throughout the spec, the requirement is that
a reference is "resolved", not that it is "discharged"; in fact, this is the
only use of the word "discharge" in the whole specification, so it's very
hard to tell what it means. For example, the XML Representation Summary for
attributeGroup says that it incorporates the attribute uses "resolved to" by
the actual value of the ref attribute - this appears to explicitly require
that the name is "resolved" as defined in 3.15.3, "discharging" it as
described in 4.2.1 is not enough.

All references are to the PER of 18 March.

Michael Kay
http://www.saxonica.com/

Received on Sunday, 26 September 2004 17:08:35 UTC