From: "bob mcwhirter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, June 26, 2001 1:45 PM
Subject: Re: [dom4j-dev] DOM Long Term Persitence


> > Any ideas, comments? Is such a persitence layer welcome in dom4j? I
think we
> > can use jdo (castor), too.
>
> Yah, Visitor is a top-down.
>
> Though, Iterator could be depth first.
>
> I've suggested, elsewhere, something like:
>
> Document.iterator( POST_ORDER );
>
> or
>
> Document.iterator( PRE_ORDER );
>
> and similar things upon Element.
>
> Gives you the same iteration (and better, in fact) than Visitor,
> without the overhead of the whole double-dispatch thing that
> visitor aims to solve.

Agreed. Being able to 'tree walk' either shallow, depth first or bredth
first orders would be useful. It would be nice to tie in with XPath support
so a depth or bredth first iterations could be supported without having API
method bloat.

e.g. to iterate through all foo elements we might have..

XPath xpath = document.createXPath( "//foo" );
Iterator iter = xpath.iterate( document, BREDTH_FIRST );

for any element:-

XPath xpath = document.createXPath( "//*" );
Iterator iter = xpath.iterate( document, BREDTH_FIRST );

etc.

James


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
dom4j-dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to