I am trying to find something in several attributes in several different nodes
This is how I find it in one attribute
//*[contains(@name,'KEYA')]
XML example:
<cars>
<car model="2000" name="Awesome KEYA Car" name2="somethine else">Brand1</car>
<car model="2005" name="Awesome Car" name2="KEYA something else">Brand 2</car>
<car name="Awesome Car" name2="somethine else">Brand1</car>
<car dontmatch="KEYA" name2="somethine else">Brand3333</car>
</cars>
What I really want is something like this for more than 10 attributes (it should only match the attributes listed in the white list),
//*[contains((@name or @name2 or @name3),'KEYA')]
Using XPATH 1.0. Any ideas on how to do this? I tried several methods, except for repetition, but did not work.
source
share