I am using XPath.I am trying to compare a value which is stored in a string and then writing a query like
XPathExpression desc_expr = xpath.compile("/algorithms/info[name=s]/description/text()");
where s contains the value and is a string.
I am getting null for this.
However if I write the query like
XPathExpression desc_expr = xpath.compile("/algorithms/info[name='somename']/description/text()");
then query works.
The string value is of the form abcd_abcd .It has a special character _.Is it because of the special character I get a null value?
Could anyone please help sort this out.
Thank you.
change
to
U need to use string concatenation to have the value in a variable be used.