Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to: XPath search case-insensitive

843834Aug 27 2003 — edited Aug 27 2003
Hi
I am doing an xpath search in my DOM tree. The query looks like this:

//employee[contains(string(@name),"abc")].

By default this search is case sensitive. Does anyone know to make this case insensitive.
One solution is to use translate function like this:
//employee[contains(translate(@name,
'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'),"abc")].

But this would cause problems during internationalisation. This just takes care of english charset.

Any ideas...Anybody?????
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 24 2003
Added on Aug 27 2003
3 comments
766 views