[jdom-interest] Default Namespace vs No-Namespace.
Eric VERGNAUD
eric.vergnaud at wanadoo.fr
Fri Jul 4 14:52:22 PDT 2003
Hi all,
I'm a little disappointed by the various positions that have been taken by
some contributors on this subject.
I thought JDOM was about 'making it simple for Java programmers to use XML'.
To me that goal is the prior reason why I switched to JDOM. The simpler my
code is (to do simple tasks), the more happy I am.
Someone wrote: 'JDOM is about moving an Element from one place to another'.
I NEVER do this. All I do is build XML documents, and read XML documents. Am
I wrong ? Should I stop using JDOM ? Am I a dummie ? Should I stop using XML
?
Jason wrote:
> It'd have to be decided when it was added to a parent. But an element
> should have a namespace URI independent of its current location in a
> tree so that if I asked the element can know if it's an xhtml:table or a
> furniture:table. It shouldn't have to say, "Wait til I'm added
> somewhere and I'll let you know. And the answer may change when I move."
Good point. But don't you think that someone who needs this is necessarily
aware of what it implies it terms of namespaces and would then create the
Element using an explicit namespace ?
John wrote:
> The default namespace is a feature of xml which allows
> you to declare one namespace at the top and for any
> element in the document which is not given a namespace
> that element will inherit the default namespace.
>
> Why is jdom's behavior set such that when I have a
> document and I set the default namespace at the root
> the child nodes of the root do not inherit the
> namespace but instead are set to the special
> no-namespace namespace.
I very much adhere to this point. I understand there can be some higher
priorities, but why can't we have *AS AN OPTION*, the possibility of
creating Elements that automatically inherit their parent's namespace ?
If this a resource issue, maybe one of us can help ?
Eric
More information about the jdom-interest
mailing list