W3C home > Mailing lists > Public > www-forms-editor@w3.org > January 2002

THREAD SUMMARY: Namespaces on attribute values (including XML Eve nt names)

From: Micah Dubinko <MDubinko@cardiff.com>
Date: Tue, 22 Jan 2002 11:03:46 -0800
Message-ID: <E840F0B7E6189547BDB91DA8BF2228AB28C16F@csmail.cardiff.com>
To: "'w3c-forms@w3.org'" <w3c-forms@w3.org>
Cc: "'www-forms-editor@w3.org'" <www-forms-editor@w3.org>, "'www-html-editor@w3.org'" <www-html-editor@w3.org>, "David E. Cleary (E-mail)" <davec@progress.com>, "'ht@cogsci.ed.ac.uk'" <ht@cogsci.ed.ac.uk>
[Notice: if replying to this message, take care with the return addresses.
Please send only public Last Call comments to the *-editor@w3.org lists. -m]

Do default namespace declarations apply to attribute _values_?

One line summary:
Yes, when using a datatype based on QName from XML Schema.

Details and background:

The initial question [1] was: are these referring to the same event (in
attribute ev:event)?

<container
  xmlns="http://container/ml"
  xmlns:xforms="http://www.w3.org/2001/12/xforms"
  xmlns:ev="http://www.w3.org/2001/xml-events"
>

<!-- (1) -->
<xforms:button>...
  <xforms:action ev:event="xforms:activate"/>
</xforms:button>

<!-- (2) -->
<xforms:button>...
  <action xmlns="http://www.w3.org/2001/12/xforms" ev:event="activate"/>
</xforms:button>

The Namespaces Recommendation [2] is silent on this--it only describes a
two-part naming system (a "Qualified Name", or "QName") and how this applies
to element names (default namespaces apply) and attribute names (default
namespaces don't apply).

XPath [3] was one of the first Recommendations to use namespaces in
attribute values. Here, default namespace declarations _do not_ have an
effect on the attribute _value_. Quoting: "if the QName does not have a
prefix, then the namespace URI is null (this is the same way attribute names
are expanded)"

The XML Schema Recommendation [4] took this further, defining and itself
using an xsd:QName datatype. It's not clear (or at least subject to debate)
on how the Schema QName datatype treats unprefixed names.

This question has been answered in the document "XML Schema: Comments on
Recommendation" [5]. Issue R-85 contains the following quote from Henry
Thompson: "This should be clarified in the REC -- the intention is that
unprefixed names are qualified iff there is a default namespace declaration
in scope, i.e. as per element names, not attribute names, in XML 1.0 plus
Namespaces." Note that this is contrary to the XPath approach.

The XML Events [6] specification says "To identify event types from other
namespaces, qualified names, as defined in [SCHEMA], should be used."
Because of the reference to Schema, event names, which occur in attributes,
are treated as having any default namespace declaration in-scope for the
value of the attribute.

The word "should", however, calls into question exactly what is the datatype
of the 'event' attribute. Clarification of the XML Events draft (especially
in the form of a Schema) would be extremely helpful, since the datatype used
affects processing of that attribute.

.micah



[1] http://lists.w3.org/Archives/Member/w3c-forms/2001OctDec/0603.html
[2] http://www.w3.org/TR/REC-xml-names/#NT-QName
[3] http://www.w3.org/TR/xpath#node-tests
[4] http://www.w3.org/TR/xmlschema-2/#QName
[5] http://www.w3.org/2001/05/xmlschema-rec-comments#pfiQName
[6] http://www.w3.org/TR/xml-events/Overview.html#section-event-naming
Received on Tuesday, 22 January 2002 14:06:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 10 June 2009 18:12:10 GMT