arrays - XPATH select by set of possible attribute values -
i have this:
<database> <exercise_muscle id="20" muscleid="1" exerciseid="1" /> <exercise_muscle id="35" muscleid="2" exerciseid="1" /> <exercise_muscle id="50" muscleid="3" exerciseid="2" /> <exercise_muscle id="50" muscleid="4" exerciseid="2" /> </database>
and want exercise_muscle nodes, have e.g. muscleid value 1, 3 or 4.. set of possible values.
i know can use "or", hoping there better solution.
how this? (runs using xpath 2.0)
/database/exercise_muscle[@muscleid = ('1', '3', '4')]
alternatively, can use
/database/exercise_muscle[@muscleid = '1' or @muscleid = '3' or @muscleid = '4']
Comments
Post a Comment