xpath: find a node that has a given attribute whose value contains a string

XmlXpathContains

Xml Problem Overview


Is there an xpath way to find a node that has a given attribute whose value contains a given string?

For example I have an xml document and want to find a node where the address attribute contains the string Downing, so that I could find the following node:

<person name="blair" address="10 Downing St. London"/>

Xml Solutions


Solution 1 - Xml

select="//*[contains(@address,'Downing')]"

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionflybywireView Question on Stackoverflow
Solution 1 - XmlvartecView Answer on Stackoverflow