looking up case insensitive element in XML with XPath

W

Wizfrog

Hello,

I want to do something simple I guess, but hit a problem:

I want to look up an element by name, using XPath, but I want my input
string to be case insensitive.

For example: I'm looking up ThisWord, but if the user inputs
"thisword" I want to be able to find the element.
This is a to avoid doublons (in a case insensitive manner)

XML is case sensitive, so "thisword" and "ThisWord" will show as
different.

So, is there an "easy" way to find all case-sensitive variations of a
word in a document? without having to look up all variations
independently?

How would you do a "search" function for example, if there is no case
insensitive way to look up text nodes?
 
B

Bjoern Hoehrmann

* Wizfrog wrote in comp.text.xml:
So, is there an "easy" way to find all case-sensitive variations of a
word in a document? without having to look up all variations
independently?

You would have to transform the input to some specific casing and
perform a case-sensitive match. Use the XPath translate() function
to do this. The alternatives would be to write an extension function
or use existing ones, or use XPath 2.0.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top