[jdom-interest] XmlOutputter - printNamespace - NO_NAMESPACE outputs xmlns="", bug?

Jason Hunter jhunter at servlets.com
Thu Jul 3 13:47:06 PDT 2003


Rolf Lear wrote:
> <jest xmlns="http://humour.net/">
> Phill wrote ...
> ".... I use JDOM as a persistence mechanism for my Java Applications and 
> there is not a single namespace in any one of the documents and I don't 
> want to have to add one when I ...."
> 
> and I say:
> 
> "Well, every root element in every document you have is in a 
> namespace... every one is in xmlns="", only you just have not taken 
> notice of that.... Further, you have added a namespace to every element 
> in every document, only you did not know that you were doing it. And 
> even stranger yet, when you had a look at the XML results of your 
> document, you did not see the namespace even though it clearly was there!"

I'd argue that's not true.  The XML 1.0 spec doesn't include namespaces. 
  You can be fully compliant to XML 1.0 and your elements will be in no 
namespace simply because there are no such things as namespaces.  :-) 
Namespaces were bolted on after the fact.

-jh-




More information about the jdom-interest mailing list