velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From piero de salvia <>
Subject Anakia and jdom
Date Tue, 03 Jul 2001 21:19:10 GMT
Hi guys,

another "should i forget programming" question.

Should not Anakia use dom4j instead of jdom ? Is not
dom4j vastly superior to jdom, considering that we are
working with java?

consider how to get an XPath engine running in jdom:

DOMParser parser = new DOMParser();
Element Site =
xpathSupport = new XMLParserLiaisonDefault();
prefixResolver = new PrefixResolverDefault(Site);
xpath = new XPath();
XPathparser = new XPathProcessorImpl(xpathSupport);
XPathparser.initXPath(xpath, PathName,

and then eval an xpath expression:

XObject result = xpath.execute(xpathSupport, Site,

NodeList foundnodes = result.nodeset();
(...more suffering from not having a standard

same thing with dom4j :

SAXReader reader = new SAXReader();
Site =;
List foundnodes = Site.selectNodes(PathName);

(have a java Collection)


piero de salvia

Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail

View raw message