Juuno
asked on
Case-insensitive XPath Expression
If my xml file structure is like this:
<file>
<entry>
<name>
<count>
</entry>
<entry>
<name>
<count>
</entry>
...
</file>
Then, the following xpath expression is to get the 'count' for the matched name with user inputted name.
Here's inputname is a variable which I 'll get input from the user. Right?
XPathExpression expr = xpath
.compile("//file/entry[nam e='" + inputname + "']//count/text()");
But it is case-sensitive, i mean if the user input is "Car" and if the name is "car". It cannot match because it is case-sensitive.
So, what I would like to know is .. can I tell xpathexpression not to be case-sensitive.
Is there anyway?
Thanks!!
<file>
<entry>
<name>
<count>
</entry>
<entry>
<name>
<count>
</entry>
...
</file>
Then, the following xpath expression is to get the 'count' for the matched name with user inputted name.
Here's inputname is a variable which I 'll get input from the user. Right?
XPathExpression expr = xpath
.compile("//file/entry[nam
But it is case-sensitive, i mean if the user input is "Car" and if the name is "car". It cannot match because it is case-sensitive.
So, what I would like to know is .. can I tell xpathexpression not to be case-sensitive.
Is there anyway?
Thanks!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.