W3C home > Mailing lists > Public > public-xml-core-wg@w3.org > April 2008

Re: Request to name the "no namespace" namespace

From: Konrad Lanz <Konrad.Lanz@iaik.tugraz.at>
Date: Wed, 23 Apr 2008 23:07:41 +0200
Message-ID: <480FA51D.4070406@iaik.tugraz.at>
To: "Henry S. Thompson" <ht@inf.ed.ac.uk>, fantasai.lists@inkedblade.net
CC: public-xml-core-wg@w3.org
Dear all,

I think the main reason for this being hard is the impedance mismatch
between CSS qualified names and "XML qualified names" and also the
different scoping of namespaces (CSS is not XML [1]).

So the least confusing spec language - from my point of view - would
make this impedance mismatch explicit.

regards
Konrad

Some more thoughts on this topic and a straw man text proposal for CSS
Namespaces Module at the end.

### Not interested in NULL in XML? Jump to "ContinueHere" ###

Given that NULL (the omission of a value) and the empty string "" are
not namespaces; it follows that one is free to use these constructs for
other things.

As the empty string is an allowed attribute value in XML it is used as a
reserved value in (xmlns="") to not inherit the default namespace. In
XML 1.1 the latter is also allowed for namespace prefix undeclarations
(xmlns:pre="") [3].

However <foo attribute=/> or <foo attribute=NULL/> is not well formed
XML, which implies that the omission of an attribute value (NULL) would
also imply the omission of the whole attribute to keep the serialized
XML well formed.
Lets call this assumption A-I.

So under A-I on could say that XML uses "" and NULL to encode namespace
scopes and this is reflected in the serialized/canonicalized form of XML.

So a namespace declaration with a NULL value in a data structure can be
understood under A-I as a non existing namespace declaration in the
serialized form.

To summarize:
* The omission of a default namespace declaration means to inherit the
default namespace.
* And xmlns="" means not to inherit the default namespace[2].

Defining xmlns="no namespace" would just add unnecessary redundancy to
that and not save people from having to understand that
elements/attributes that are in no namespace can coexist with those in
some namespace and that can happen in the same document at the same time.

Most of that is quite obvious, but less obvious is that an element does
not necessarily need to have the empty string to have no default
namespace (It depends if there is a default namespace in scope). Also
less obvious is that an element/attribute without namespace cannot have
a prefix. In fact attributes without prefix never have a namespace.

### Continue Here ###

So there is an impedance mismatch between namespaces, qualified names
and their scope in XML and the same constructs in CSS.

There is no nesting in CSS and there is no nested namespace scoping
(inheritance) in CSS. If one would add this to CSS, one would probably
end up with XML again.

The least confusing spec language from my point of view would make this
impedance mismatch explicit.

The text could read as follows:

A CSS qualified name (cssQName) matches named particles such as elements
and attributes of an XML document.

* A cssQName without prefix is syntactically a local name; and depending
  on whether a default-namespace has been defined:
    - it either selects particles that have no prefix, (for elements,
      additionally no default namespace is in scope) and the local name
      is matches,
    - alternatively if the default namespace is defined, the selection
      is done by matching the namespace values and the local name.

* A cssQName without a prefix can also be prepended by a by a "vertical
  bar" (|||, U+007C) which only matches particles that have no namespace
  (i.e. an empty cssPrefix matches particles whose local name does not
  lie in any namespace; for elements this means additionally that no
  default namespace is in scope).

* A cssQName with prefix is a constructed by a cssPrefix followed by a
  "vertical bar" (|||, U+007C) and a local name (such as an element or
  attribute name).
  A cssQName selects particles explicitly located within (associated
  with) a namespace via its cssPrefix. The cssPrefix, represents the
  namespace for which it has been declared. Some contexts may allow the
  use of an asterisk (|*|, U+002A) as a wildcard prefix to select
  particles of any namespace, those having no namespace.

[1] CSS itself is not using an XML syntax because its early versions
predate XML and newer versions of CSS may not have switched to an XML
syntax and because Lie did not want to end up with a programming language.
Hakon W. Lie and Bert Bos. Cascading Style Sheets. Pearson Addison
Wesley, June 2004

[2] http://www.w3.org/TR/xml-names/#scoping
[3] http://www.w3.org/TR/xml-names11/#scoping

-- 
Konrad Lanz, IAIK/SIC - Graz University of Technology
Inffeldgasse 16a, 8010 Graz, Austria
Tel: +43 316 873 5547
Fax: +43 316 873 5520
https://www.iaik.tugraz.at/aboutus/people/lanz
http://jce.iaik.tugraz.at

Certificate chain (including the EuroPKI root certificate):
https://europki.iaik.at/ca/europki-at/cert_download.htm





Received on Wednesday, 23 April 2008 21:08:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 23 April 2008 21:08:46 GMT