[jdom-interest] Additional namespace issues

Jason Hunter jhunter at collab.net
Fri Dec 15 11:01:08 PST 2000

> I'd actually like to propose a more radical shift, though I'm not the
> first to propose this idea.  It has been brought up before.
> Instead of (or perhaps in addition to) getAdditionalNamespaces()
> there should be a getNamespacesInScope() method that returns a list
> of all the namespaces which apply to that element. This is what's
> needed for resolving namespace prefixes in attribute values, for
> example.

So with that proposal we still need the method that attaches a new
"unused" namespace to an elt, but instead of just getting what's been
attached you would query for what's in scope on that elt?  The results
of that call are transient based on the element's location within the
tree.  That's a bit odd.  It's also an up-the-tree search to determine
the namespaces in scope, so it wouldn't be used by an outputter.  An
outputter would be better served by keeping its own stack as it does

Hmm... We ourselves don't need to resolve namespace prefixes on attrib
values, correct?  So what's the use case for this new method?

> The only real need for getAdditionalNamespaces() is for XMLOutputter.

DOMOutputter and SAXOutputter too.


More information about the jdom-interest mailing list