[jdom-interest] Default Namespace vs No-Namespace.
John Jefferson
surfer97301 at yahoo.com
Thu Jul 3 17:10:07 PDT 2003
Thanks for all the dialog!!, I think I have a good
unstanding of the situation now.
Basicially the design decision that all elements know
which namespace they belong to at all times prevents
you from using some features of namespace inheritance?
I mean, forgetting how jdom works for a moment, if I
have a document with no namespacing and then I want to
make all elements adher to a namespace then all that I
have to do is add xmlns="mynamespace" to the root
element using a text editor and all children will then
inherit this namespace.
In order to do this in jdom, I'd have to iterate
though the entire set of nodes and set each node to
the given namespace.
I do understand your points and I don't have a good
solution on how to solve this, I suppose it is just
frustrating that what I can do with a text editor with
a single node change I can not do with jdom without
modifying the source.
Jdom is a nice piece of work, thanks for all the hard
work!
JJ
> As I wrote previously, the name "default namespace"
> was poorly chosen
> because it implies it acts as a default in the
> absence of something. It
> also implies there's just one. Simply think of a
> default namespace as
> any namespace that happens to have an empty string
> prefix.
> Considering that you have have a large number of
> "default namespaces" in
> a single document (as many as one per element) and
> that elements are
> built without knowing where they're going to go, we
> really wouldn't even
> know which of the many default namespaces to choose
> for any new element.
> 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."
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
More information about the jdom-interest
mailing list