In an XML document such as:
<a>
<b>
<c>Text1</c>
...
</b>
<b>
<c>Text2</c>
...
</b>
...
</a>
What is a single XPath 1.0-compatible, local-namespace()-compatible, expression to return a Null set if any element contains the inner text of 'Text1'.
I have tried numerous different expressions and cannot get elements that would return a null set.
e.g.
//*[local-name()='c' and .='Text1']
- or -
/*[local-name()='a']/*[local-name()='b']/*not(local-name()='c' and .='Text1'])
The stringent requirements are due to a specific implementation of the .NET function call XmlNode.SelectSingleNode Method (String)
Final exact solution Courtesy Dimitre
/*[not(//*[local-name()='c' and . = 'Text1'])]