[jdom-interest] recursive getAdd'lNS()?

bob bob at accurev.com
Fri Oct 13 13:20:50 PDT 2000


I'm glad to have the data-centric getAdditionalNamespaces(),
but would a recursive version, injecting XML semantics
also be appropriate?

<a xmlns:foo="http://toast.org/">
  <b xmlns:foo="http://jelly.org/">
    <c myAttr="foo:tacos/.."/>

I could walk, from <a> to <c>, collecting, and overriding
namespaces, but that seems to be a common action that
would nicely be embodied by Element itself, maybe?

In this case, we'd end up with a single Namespace of
foo->http://jelly.org, right?  

I could see Various People writing their own Element
traverser, to figure out which namespace a prefix
maps to at a given Element, and I could see Some
Of Them, getting the semantics/implementation wrong.

For applications like XSLT (and maybe others),
it's not so much as the actual Namespaces declared
on a particular Element, but rather, the current
mappings between prefix->nsURI.

If this sounds valid, would you accept a patch?


More information about the jdom-interest mailing list