[Bug 4908] 'The schema corresponding to a schema document' and QName resolution

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4908

           Summary: 'The schema corresponding to a schema document' and
                    QName resolution
           Product: XML Schema
           Version: 1.0/1.1 both
          Platform: Macintosh
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Structures: XSD Part 1
        AssignedTo: cmsmcq@w3.org
        ReportedBy: cmsmcq@w3.org
         QAContact: www-xml-schema-comments@w3.org


The Schema Representation Constraint: QName resolution (schema
document) says in clause 1 that for a given QName in a schema document
to resolve to a component, it must be true that:

    That component is a member of the value of the appropriate
    property of the schema which corresponds to the schema document
    within which the ·QName· appears ...

Some problems exhibited by this passage may need attention.

First, in this context, "the schema which corresponds to the schema
document" clearly denotes the schema within which the reference is to
be resolved; typically that will be the schema currently being
constructed.  And typically (or necessarily), that schema will include
components for all the source declarations of the schema document in
which the QName occurs.

But the use of the article "the" suggests wrongly that there is just
one such schema, whereas in fact there are an infinite number of such
schemas.

So the word "the" in the phrase "the schema which ..." should probably
be removed.

Second, the notion of "the schema which corresponds to the schema
document" is also used pervasively in section 4 of Structures, where
however it appears to mean not "the current schema" but specifically
"the schema containing the components declared by the source
declarations in this schema document, plus those declared in documents
included or redefined ... from this one".  (Alternatively, in section
4 the phrase does mean "the current schema", and all of the schema
representation constraints that say things like

    The XSDL schema corresponding to <schema> contains not only the
    components corresponding to its definition and declaration
    [children], but also all the components of all the XSDL schemas
    corresponding to any <include>d schema documents.

are all vacuous, because they amount to saying that the schema being
constructed contains components identical to those in the schema being
constructed.)

In the QName resolution rule, however, "the schema which corresponds
to the schema document" cannot have this restricted sense.  It is not
(I think) required that the QName denote a component declared in the
same schema document, or in some schema documents included (or
redefined or imported) by the current schema document (or by any other
schema document in the transitive closure of the
schema-document-reference relation.  That would make cross-document
component reference much harder than it should be.  (Alternatively, I
have misunderstood, QNames ARE supposed to resolve only if declared in
the same schema document or an included/redefined/imported schema
document, and cross-document component reference is only allowed in
those circumstances.)

Unless I have misunderstood our spec badly, the phrase is correct (if
a little underspecified) in the context of section 4, and out of place
in the QName resolution rule.

Third, even in the context of schema composition, our spec does not
uniquely determine a single schema corresponding to a given schema
document: the schema is a function of (a) a given set of schema
documents that the process may start with, (b) the policy adopted for
following inter-schema-document references, (c) the availability, to
the validation process, of material at the locations where material is
sought, at the moment when it is sought (network outages and
restricted access policies might both affect this).  There may be
other factors.

So again the word "the" entails guarantees on which XSDL is not
prepared to make good.  Either we need to specify conditions or
simplifying assumptions which make the result of schema construction
unique, or else we need to avoid making the claim (implicit in
"the") that the result is unique or deterministic.

Fourth, I'll just note in passing that the function of this rule is to
specify what is denoted by a QName in a schema document, interpreted
as referring to a component in a given schema.  I have trouble
understanding how it could be understood to be a constraint, or what
it is intended to constrain.  (The QName? the schema? the schema
document? Huh?  It might be taken to constrain the processor, but
nothing in the text mentions the processor or expresses a rule which a
processor could follow or not follow.)  Like many of the paragraphs
labeled "constraint" in XSDL, this one specifies the meaning of a
construct and not a constraint.

Received on Thursday, 2 August 2007 02:27:58 UTC