I'd like to know how to search for a particular word in a child element.. like searching for the word "happy" in
<word>i'm feeling happy<word>
I can search for the whole sentence, and i can check using "contains" function that the word actually exists there, but i want it to return the element not just returns true!
You want elements where the text contains "happy"? When your requirements contain that word "where", that means you should use a predicate. So your XPath would look like this:
word[contains(*,'happy')]
H Melua
Ranch Hand
Joined: Jan 04, 2005
Posts: 168
posted
0
Thanks, but that doesnt seem to return anything at all
i've tried doing this..
but that didnt work either , when i check the list returned from this query, it tell me that the size of the list is 3 (which is right) but when i try to extract the word element using
now it works!!! bloody hell, it took me weeks to figure out why it wasnt doing it!! i had to demonstrate 2 of my assignments without making my lecturer realise that the search wasnt working correctly!
oh well, now it does
Thanks very much again :thumb: [ November 27, 2007: Message edited by: H Melua ]