[jdom-interest] Question about ElementScanner
cowtowncoder at yahoo.com
Sat Mar 26 08:33:41 PST 2005
--- Michael Smith <mikesmi at nc.rr.com> wrote:
> I want to create a way to search through XML
> documents and perform a search
> and replace on certain elements regardless of their
> place in the hierarchy.
> I'm thinking ElementScanner is useful here? If so,
> can someone point me to
> an example of its use. If not, can you suggest
> another/better strategy?
Actually, that sounds like an ideal candidate for
using a raw streaming parser (SAX, StAX) -- there's
no need to build a tree structure when you don't
really need one. So JDom might be an overkill without
adding all that much value (although it obviously can
easily handle this in number of ways).
In case of SAX, you'd just replace characters() event
before passing it on.
-+ Tatu +-
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
More information about the jdom-interest