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"]
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"]
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']