[jdom-interest] Newbie question

Soumanjoy Das SoumanjoyD at InterraIT.COM
Tue Jan 15 19:41:22 PST 2002


Hello All, and Happy New Year.

I've been programming in Java long enough not to be a newcomer, and I have
fairly good experience in Microsoft XML-DOM. But I'm still inexperienced in
Java JDOM, and have only programmed in it using the jdom.jar that we had
downloaded sometime ago. 

What I want to do is: to be able to use an XSL query in a JDOM root or node
object to return a single node or collection of nodes. In MS XML, one would
do it this way:
1) E.g. if we were to select the first node with name "block" having
attribute "id" with a value "123"
objNode = objRoot.selectSingleNode("//block[id='123']")

2) E.g. if we were to select all the nodes with name "block" having
attribute "id" with a value "123"
objNode = objRoot.selectNodes("//block[id='123']")

Would anyone please let me know how to achieve this in JDOM, and what jars
are required and from where? (I had looked it up over the net and came over
some documentation regarding this, which provided jars named jaxen-jdom and
sax-jdom etc., but they were either incomplete or inadequate). I'd be
grateful for your help.

Thank you
Soumanjoy



More information about the jdom-interest mailing list