Welcome to WebHeadStart.org

Web Technologies

Sponsored By

WebHeadStart.org is currently in beta.
Please pardon our appearance as we work to provide you with the most comprehensive reference on today's web technologies.

Interested in advertising on WebHeadStart? Become an advertising partner today!

[WWW-HTML Mailing List Archive Home] [Messages By Thread] [Messages By Date]

Re: XHTML attributes and namespace, clarification needed

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Tue, 14 Dec 2004 13:48:44 +0100
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Cc: www-html@w3.org, www-style@w3.org
Message-ID: <41cedefe.111444812@smtp.bjoern.hoehrmann.de>

* Daniel Glazman wrote:
>Can you please explain me why attributes applying to XHTML elements have
>to have no namespace ? Giving them a namespace is not a blocker for other
>vocabularies since it's possible to build an RNG schema defining only
>attributes.

Because that saves you from specifying the namespace each time you work
with an attribute, you would otherwise end up doing

  <p xhtml:align="...">                   in XHTML
  //xhtml:p[@xhtml:align]                 in XPath
  p.setAttributeNS("http://...", "align") in Script
  p[xhtml|align]                          in CSS
  ...

rather than

  <p align="...">                         in XHTML
  //xhtml:p[@align]                       in XPath
  p.setAttributeNS(null, "align")         in Script
  p[align]                                in CSS
  ...

which is important e.g. for authors who wish to use XHTML but need to
consider old user agents that do not properly support XHTML (e.g., if
the user agent is not able to render XHTML documents progressively...),
and generally to anyone who hates typing all those characters. As there
is not much to gain from having those attributes in a namespace, such a
requirement has been avoided. Or is your question why the XML Namespaces
specification does not consider attributes without prefix to be in the
namespace of the element they are attached to?
-- 
Björn Höhrmann · mailto:bjoern@h... · http://bjoern.hoehrmann.de 
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de 
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/  
Received on Tuesday, 14 December 2004 12:49:01 GMT
Valid XHTML 1.0! Valid CSS! Site Map | Privacy Policy | Terms of Use | WebHeadStart.org © 2005 All Rights Reserved.