Reputation: 594
i want to find nodes containg an attribute with a certain value in XML . I tried with a certain Xpath expression but it wont work..
String expression = ".*[@*[starts-with(., '"+search+"')]]";
Here the search
is the variable which contains the value which i want to search. Can anyone tell me the right Xpath expression.
Thanks.
Upvotes: 1
Views: 164
Reputation: 338208
Your expression is correct, only the .*
makes no sense.
String expression = "//*[@*[starts-with(., '"+search+"')]]";
Upvotes: 1