0

How would I match the following two items with one xpath?

<locales>
        <locale name="nl-NL">
</locales>

<locales>
        <locale name="NL-NL">
</locales>

So far I have a case-sensitive match of:

//locales/locale[@name="nl-NL"]
David542
  • 104,438
  • 178
  • 489
  • 842
  • already asked. check this out: http://stackoverflow.com/questions/2893551/case-insensitive-matching-in-xpath – pingz Mar 02 '15 at 00:35

1 Answers1

3

You can use the following XPATH:

//locales/locale[translate(@name,'nl','NL')='NL-NL']

Or, if there are just two values, you can use even this:

//locales/locale[@name='NL-NL' or @name = 'nl-NL']
Lingamurthy CS
  • 5,412
  • 2
  • 13
  • 21