XPath query: why no results?

motherboardlove

New Member
I have the following XML:\[code\]<pets> <dog name="Rupert" color="grey"/> <dog name="Ralph" color="brown"/> <cat name="Marvin the Cat" color="white"/> <cat name="Garfield the Cat" color="orange"/> <cat name="Cat" color="grey"/> <cat name="Fluffy" color="black"/></pets>\[/code\]I have the following XPath query:\[code\]//cat[@*[translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')] = 'marvin the cat']\[/code\]But it returns no results. I'm trying to translate the value of the \[code\]@*\[/code\] to be lower case.What I am looking for is a result that "matches whole word" while being case insensitive. How can I change this query to achieve the result I want?Note: I had wanted to use the XPath 2.0 \[code\]matches\[/code\] function, but I just found out I'm limited to XPath 1.0. Therefore I need a workaround!
 
Back
Top