Namespace question: Do attributes inherit the element's namespace?

David Megginson david at megginson.com
Thu Jan 6 19:12:13 GMT 2000


Leigh Dodds <ldodds at ingenta.com> writes:

> Attributes don't have namespaces. And therefore your tools are correct.
> 
> Attributes live in the per-element-type partition.
> 
> See http://www.w3.org/TR/REC-xml-names/#ns-breakdown, and
> http://www.w3.org/TR/REC-xml-names/#ns-expnames for some examples of
> how Namespaces are applied to attributes.
>
> The acceptions are 'global' attributes which live in a separate
> partition, the global attribute partition, and these can have a
> Namespace.
> 
> I don't claim to fully understand this though

[snip]

You're not alone -- this point has caused as much confusion as any
other in the Namespaces spec.

Remember that Namespaces have to do simply with identification (this
is an A) and distinction (this is not a B); they don't say anything
about what A and B mean.

Basically, then, the main question was whether the attribute names in
the following two examples are identical:

  <html:a href="foo">

and

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

For most applications (such as RDF, and, possibly, XSL), the answer is
a firm 'no', but the WG decided to make it *possible* to distinguish
the two in case anyone ever thinks of a good reason to do so.


All the best,


David

-- 
David Megginson                 david at megginson.com
           http://www.megginson.com/

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