[jdom-interest] Namespace issues, et al.

Elliotte Rusty Harold elharo at metalab.unc.edu
Sun Feb 23 12:42:06 PST 2003


At 12:17 PM -0800 2/23/03, Malachi de AElfweald wrote:

>>From what I see there, it says that "the interpretation of unprefixed
>attributes is determined by the element on which they appear" The 
>quote you used is right after they say "If there is no default 
>namespace declaration in scope, the namespace name is null".  Thus, 
>I understand that to say that it uses the element in which they 
>appear, unless there is no default namespace.
>
>Isn't that what it actually says?

Yes, but you're not reading it right. There is nothing in that 
paragraph that says the namespace name of an unprefixed attribute is 
anything other than null. In fact it says exactly the opposite: "The 
namespace name for an unprefixed attribute name is always null." 
Always means always, not always except when the element has a 
namespace.

It also says, as you quote, "the interpretation of unprefixed 
attributes is determined by the element on which they appear" but 
interpretation != namespace name. All that phrase means is you have 
to look at the element name to figure out what to do with that 
attribute. It in no way means the attribute suddenly picks up a 
namespace name. You're reading things into the spec that just aren't 
there.
-- 

+-----------------------+------------------------+-------------------+
| 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