[jdom-interest] Is JDOM dying?

Stephan Trebels stephan at ncube.de
Fri Mar 14 10:19:21 PST 2003

On Fri, 2003-03-14 at 17:55, Vadim.Strizhevsky at morganstanley.com wrote:
> You have tree A that has INHERIT tags. You output it and read back in. You
> now have tree B that doesn't have INHERIT tags. Semantically the 2 trees
> are identical. However it would be hard/impossible to write code that
> could treat the 2 trees the same. Imagine having to pass you tree to some
> 3rd party code that you have no control over. Do you expect them to
> correctly deal with both situations? If not, then you broke the API
> compatibility/stability.
Point taken.  I'd have to do a JDOM-JDOM Namespace-expansion first...

I always use JDOM to read XML and process, plus build XML for output
using JDOM.  I never process JDOM trees I built myself.  Thus this could
not happen to me.  If you build JDOM and then pass the tree to something
else for processing which is NOT using SAX events, this would be
problematic. Of course, the getNamespace call could lie, but this
_would_ be ugly.

> Outputters are not the only things that look/examine/iterate over the
> tree. And many other things you don't have control over. I don't see a way
> to make the new model such that the tree A and tree B would  get
> intepreted correctly and identically by the same code. More so, by the
> code that exists today with current API.


> Anyway, it should be fairly simple to write "inherit" functions that given
> a parent and a child copies the parent's namespace to the child. You can
> use these functions on construction, thus achieving basically what you
> want.

I'll have no use personally for these... I was just trying to find a
compromise with people who seem to have use.  

INHERT Namespaces could do something like
copy-namespace-from-parent-on-attach-for-whole-subtree.  Then any tree
would be fine if the namespace of the "root" node of the tree is set.  

Still breaks the API, as trees can exist, which have all
Namespace.INHERIT as the namespace...  OK, it was at least an try.

        Stephan Trebels <stephan at ncube.de>   Consultant
company: nCUBE Deutschland GmbH, Hanauer Str. 56, 80992 Munich, Germany
phone: cell:+49 172 8433111  office:+49 89 1498930  fax:+49 89 14989350

More information about the jdom-interest mailing list