The JDOM XPath class has a method called setVariable, and variables in XPath expressions start with the $ character. I've never played with the JDOM XPath stuff, but I assume it's something like:

XPath xp = XPath.newInstance("/*/*/[EMAIL PROTECTED]");
xp.setVariable("map", "europe");

Prashanth.S wrote:

Hi all,
Iam using jdom for xml parsing....so to search a particular element in a xml iam using 
XPATH and iam trying to construct XPATH expression dynamically....is it possible to 
use variables inside XPATH expression....like
String map="europe";
XPath servletPath = XPath.newInstance("/*/*/[EMAIL PROTECTED]");
Iam eagerly waiting for reply...
Thanks
Prashanth

-- Kris Schneider <mailto:[EMAIL PROTECTED]> D.O.Tech <http://www.dotech.com/>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to