[jdom-interest] Namespace issues, et al.

Alex Rosen arosen at novell.com
Tue Feb 25 10:20:54 PST 2003

We're both trying to say the same thing here. Sorry if I wasn't clear.

The XHTML spec could have said that you must ensure that your href
attribute is in the null namespace (by using no prefix), or it could
have said that you must ensure that your href attribute is in the XHTML
namespace (by using a prefix). It chose to do the former, but it could
have done either.

But it's the XML spec that specifies that, if the attribute has no
prefix, then it's in the null namespace, regardless of what namespace
the parent element is in, and regardless of what the XHTML spec says.


>>> Elliotte Rusty Harold <elharo at metalab.unc.edu> 2/25/2003 11:29:46
AM >>>
At 9:09 AM -0700 2/25/03, Alex Rosen wrote:

>(2) As someone mentioned, it's often up to the parent element to
>how to interpret its attributes. The XHTML <a> element could either
>specify that it has a child "href" in the null namespace or in the

No, XHTML can't do that. Please let's not confuse the issue further. 
The href attribute of the XHTML a element has no namespace name. 
There is no wiggle room on this. The XHTML spec cannot decide to do 
this one way or the other. The namespaces spec is authoritative on 
this point.

The XHTML spec can say what browsers should do with href attributes 
of a elements, but if it wants the href attribute to be in the XHTML 
namespace, then it must assign a prefix to that attribute which is 
mapped to the XHTML namespace. It can't do this by fiat in the spec.

| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
|           Processing XML with Java (Addison-Wesley, 2002)          |
|              http://www.cafeconleche.org/books/xmljava             |
| http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA  |
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |

More information about the jdom-interest mailing list