RE: Spec question

The example is intended to clearly demonstrate that the attribute "a" in the
context of the <good> element in the '' namespace is local
to <good>.  On the other hand, the attribute "n1:a" is a "global" attribute
from the '' namespace.

You might point out that there is currently no way to declare global
attributes using DTDs.  However, (1) this doesn't mean that there might not
be a way to do so in the future. (2) The spec wants to be very careful to
ensure that whatever API is designed to return the attributes of an element
makes it very clear to distinguish between "a" and "n1:a" in this example.
Specifically, this is to avoid a common assumption that because "a" is an
attribute on the element <good>, which is from the ''
namespace, that the namespace of "a" must be ''.  It is
not.  "a" essentially has no namespace, it is merely a local attribute to
the element <good> from the '' namespace.

I hope this is clear.  There is quite a lot of discussion on this subject in
the archives.

-----Original Message-----
From: []
Sent: Friday, December 04, 1998 3:00 PM
Subject: Spec question

Section 5.3 "Uniqueness of Attributes" explicitly states that the
following is legal:
<x xmlns:n1=""
     xmlns="" />
    <good a="1"     b="2" />
    <good a="1"     n1:a="2" />

however, in the second "good" example both attribute's namespace names
are equivalent (the default of: "" and the explicit
"n1"=""). So it seems to me that it really is illegal.

Please clarify...


Received on Friday, 4 December 1998 20:04:43 UTC