Having the XML
<node attribute="value1">text</node>
what would be the XPath to extract the text
if attribute
is value1
or value2
? For any other attribute value I'm expecting no match.
What works for me is
/node[@attribute = 'value1' or @attribute = 'value2']/text()
Is there any shorter notation for the same? I don't want to duplicate attribute name twice.