[jdom-interest] How to ease traversal of JDOM tree

Laurent Bihanic laurent.bihanic at atosorigin.com
Tue Nov 20 01:12:57 PST 2001


rpcee wrote:

> There are 2 options:
>   1. use an interface based api such as dom4j or dom
> 

I said "simple interface". A definition neither DOM nor DOM4J comply with!


>   2. use decorators to provide interface functionality. This is covered in 
> Java and XML, also the reasons why interfaces aren't used. Having seen how 
> elegant and customisable the decorators are, I no longer see the need for 
> interface approach.
> 

I'm not asking to define every node-type class (Document, Element...) as an 
interface first and then provide a default implementation. I evaluated DOM4J 
and decided to continue with JDOM because it is simpler and the JDOMFactory 
provides everything I want when I need to use custom nodes.

Now this is not a reason for not improving things when you think there room 
for such improvements. JDOM is easy and simple to use most of the time but one 
area were simplicity disappears is when you want to walk the document tree.

Sure I could use the JDOMFactory to implement my own "walkable" version of 
JDOM node classes (and maybe I'll do) but I think the proposed feature is 
general enough to be worth being included in the JDOM core.

Laurent




More information about the jdom-interest mailing list