[jdom-interest] namespace nit in B6
Kyle F. Downey
kdowney at amberarcher.com
Tue Jul 3 08:25:34 PDT 2001
>
> That may not affect this though because if you explicitly made a
> Namespace with the prefix "stdbs" for the key element, then the
> outputter is doing the right thing in preserving that prefix in the
> document.
>
Okay, thanks. It's strange, though. When I read my document,
I use a Namespace (NS) that specifies stdbs but it correctly
gets the children with elem.getChildren("key", NS) if NS is
the default namespace. If I create a new element with the name namespace
with new Element("key", NS) in a document where NS is the default, it
makes it explicit: i.e., reading and writing are not equivalent.
The asymmetry means I'll need a Namespace NS_DEFAULT to use for
creating new elements in documents where I know NS is the default.
That kind of logic feels like something an application should not
need to handle, but I can see where you're coming from too.
--kd
More information about the jdom-interest
mailing list