The per-element-type namespace partition

Tim Bray tbray at textuality.com
Mon Dec 20 18:05:04 GMT 1999


At 12:16 PM 12/20/99 -0500, Joe Lapp wrote:
> What will I break if I effectively lump all per-element-type attributes 
>into a single universal "default" namespace and require applications that 
>need this information to retain information about the elements to which such 
>attributes belong?  Why didn't the W3C just allow an unqualified attribute 
>to assume the namespace of its owning element?  And what am I to infer from 
>the fact that the "per-element-type partition" is defined in a "non-
>normative" section of the Namespaces in XML specification?

The key question that took up literally months of the WG's time was, what
about the following two elements:

<html:a href="foo">
<html:a html:href="foo">

The question was, are these two

(a) the same in all cases
(b) never the same thing
(c) sometimes the same

(a) is probably the most common case, and what you're proposing doing.
But at the end of the day, the WG simply couldn't bring itself to decree
that they must always be the same.  Another way to ask the same question
is: in <html:a href="foo">, what namespace is href in?  The fuzzy, 
non-precise answer that kept coming up was "it's in the namespace of
the <html:a> element".  That sounded good to everyone but it was hard
to understand at a programmer-level term just what it meant.

So the language in the spec allows the pair of examples to be treated
as non-equivalent by an app that wants to do so.  The non-normative
appendix tries to make the notion of "the namespace of an element"
useful.

To get back to your question, I'm unconvinced that you have a problem.
If you're going to extract an attribute from a doc and do things
with it, you probably want to remember what element type it came
from anyhow.  Element types have two parts and that's all there is to it.
At some point you're going to have to deal with
<html:a xlink:role="foo"> anyhow; that attribute has potentially 4
pieces of identifying information and there's no getting away from it.
 -Tim

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)





More information about the Xml-dev mailing list