Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   dynamically parse xpath predicates (http://www.go4expert.com/forums/dynamically-parse-xpath-predicates-t17149/)

Juuno 26Apr2009 15:46

dynamically parse xpath predicates
XPathExpression expr = xpath.compile("//catalog//book[title='Midnight Rain']//author//text()");

In the above code, the result will be the author node value in which the tile is 'Midnight Rain', right? But I would like to parse that value dynamically from user input instead of constant value. Like, for example: XPathExpression expr = xpath.compile("//catalog//book[title=input-got-from-user]//author//text()");

How can i do this? Thanks in advance.

All times are GMT +5.5. The time now is 20:40.