[jdom-interest] The default namespace behaviour

Paul Libbrecht paul at activemath.org
Wed Jun 7 00:54:31 PDT 2006


Just for your help... it is a common mistake to think together XML files 
and the XML information model as stored, for example, in JDOM.
The XML specification describes the information model and describes how 
this can be written to and parsed from files.

Colin LeMahieu wrote:
>
> I was hoping to mimic the behavior that XML files have. When using the 
> default namespace, all un-prefixed sub elements are within that namespace.
>
> [....]
>
> This doesn’t fit the XML idea that, if you change the parent’s 
> namespace, un-prefixed children will implicitly change their namespace.
>
What you seem to be requesting is that JDOM elements behave like XML 
files being parsed and, at least I feel, this is wrong.
But the XMLOutputter will do the correct job if you change the namespace 
of all children elements... it will output the namespace declaration 
just once as you wish the file to appear, I think.

paul


More information about the jdom-interest mailing list