[Bug 4395] QName lexical mapping - where do the ns bindings come from?

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

           Summary: QName lexical mapping - where do the ns bindings come
                    from?
           Product: XML Schema
           Version: 1.1 only
          Platform: Macintosh
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Datatypes: XSD Part 2
        AssignedTo: cmsmcq@w3.org
        ReportedBy: cmsmcq@w3.org
         QAContact: www-xml-schema-comments@w3.org


The discussion of the QName datatype currently lacks any formal
discussion of its lexical mapping; we abandoned that as a requirement
when we went to Last Call (bug 1904).  

I would like to avoid reopening bug 1904, since it's still not clear
to me how best to treat context dependencies like those governing
namespace bindings, in the context of our formal definitions of
lexical mappings.

But in practice, it's clear that the mapping for a particular QName
depends both on (a) the namespace bindings in scope where it occurs
and on (b) whether unqualified names are bound to the default namespace
(as specified in the Namespaces spec for element names) or not (as
specified for attribute names).

We have made clear that in interpreting schema documents, attributes
of type QName are interpreted using the [in scope namespaces] of
the schema document's infoset, and using a mapping which is
default-sensitive.  (Actually, the question comes up from time to time,
so perhaps we didn't make it clear enough.  But that's a separate
issue, for Structures, not for Datatypes.)

But we have not said, for the QName type in general, some things
that I think we really ought to say explicitly.  The spec should
either specify where the namespace bindings come from, or specify
that users of the type really need to say which bindings are used.
Perhaps we will want to say that when QNames appear in XML, the
bindings come from the XML document, and if they are used elsewhere,
the specifier of the context needs to say where the bindings 
come from.  (Tricky wording needed here, to handle XPointers 
appearing in XML documents.)

We should also either specify explicitly that the QName type 
always follows the element-name discipline, or say that the user has
some ability to specify the alternative attribute-name discipline,
for unqualified names.  If the element-name discipline is assumed,
then it may be worthwhile to add a note that users can get the
effect of the attribute-name discipline by using a union of
xsd:NCName and xsd:QName and defining the interpretation rules 
for NCNames appropriately.

Having thought about this now for the time it has taken to draft
this issue description, I now realize we could draft a formal 
treatment of the effective lexical mapping as a ternary function
which takes the lexical representation, a set of namespace
bindings, and an attribute-discipline-or-element-discipline flag.
That at least allows us to make explicit that the ns-bindings
and discipline arguments depend on some context outside the scope
of XSD. 
some context

Received on Thursday, 15 March 2007 17:30:35 UTC