xpath: implementing search

Questions about XML that are not covered by the other forums should go here.
zqzproject
Posts: 4
Joined: Wed Nov 09, 2005 4:48 pm

xpath: implementing search

Post by zqzproject »

hi, in my java code, i have the following string as asearch string so as to look up for some particular nodes in an xml file:


xpathselect="//contact[child::"+ keywords + "/child::text()='" + keywordsvalue + "'";


however that selects the element with EXACTLY THE SAME value of keywords, not a sensible mechanism. so i d like to know if there are any wildcards in xpath or any way that i can do that so that i can do something like:

xpathselect = ""//contact[child::name/child::text()='*myname*']""

whihc then returns any contact whose name CONTAINS THE string myname? i know there is a function 'contains' in xpath, but have experimented alot still cant get it work. any hints pls?

thanks alot!!
zqzproject
Posts: 4
Joined: Wed Nov 09, 2005 4:48 pm

Post by zqzproject »

sory, sorted! simply apply the string to a contains function will do!
Post Reply