XML Namespace Specification
Date: Mon, 01 Feb 1999 10:03:50 -0800 From: Tim Bray <email@example.com> To: james anderson <James.Anderson@mecomnet.de>, XML Dev <firstname.lastname@example.org> Subject: Re: Another errata?
At 06:35 PM 2/1/99 +0100, james anderson wrote:
>While I could live with the assertion, I would, unfortunately, be unable to >write useful software which conformed to it. If an "unprefixed attribute name" >is really not in any namespace, then it would be impossible for application >code to execute an affirmative comparison against the name, and it would be, >for similar reasons, impossible to write xsl patterns which addressed the >attribute. Are these consequences really intended?
The namespace spec gets more over-interpretation than any document this side of the Old Testament. It seems simple to me.
There are abstract things called "namespaces", each identified by some URI
There is a syntactic mechanism, involving reserved attributes, placeholder tokens, and colon-delimited prefixes
The mechanism can be used to map namespaces directly to element types
The mechanism can be used to map namespaces directly to attribute names
There is a defaulting mechanism to map namespaces to unprefixed element types, purely syntactic sugar
The spec says nothing normative about the relationship between namespaces, as defined in #1, and an unprefixed attribute.
Appendix A provides a scheme which can be used to create a unique identifier for each element type & attr name in a document, using in part the namespace information.
If it's any consolation, this very issue was more or less what tied up the WG for months and months. What really crystallizes it is the question, given this:
what can you say about the namespace of the
href= attribute? The
most common and reasonable-sounding answer is, "it's in the namespace
of the html:a element". OK, but what does that mean, formally? It
turns out to be hard to write down. You could decree that it's in
the HTML namespace. A consequence of this is that
<html:a href="foo"> is identical to
which it might be in some circumstances; but always, for all element types and all namespaces? Tough to buy into.
Anyhow, the final consensus was that all you can say about the href= above is that it's attached to an element that's in the html namespace. For the purposes of many applications, that might be equivalent to being in the html namespace; but that interpretation isn't compulsory. For places where you want it to be compulsory, go on and prefix the attributes.
In my first few implementations of namespace-savvy software, I've had no trouble finding the attributes I needed. What's a scenario that causes problems? -Tim
xml-dev: A list for W3C XML Developers. To post, mailto:email@example.com Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ To (un)subscribe, mailto:firstname.lastname@example.org the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:email@example.com the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:firstname.lastname@example.org)