I have sitemap like XML, of which every element has an attribute "url", e.g.
<record menu_id="240" name="Countries and States" url="Countries.aspx">
<record2 page_id="54" url="CountriesEdit.aspx" />
<record3 page_id="27" url="Regions.aspx">
<record4 page_id="55" url="RegionsEdit.aspx" />
</record3>
</record>
I need to compare whether a string value contains the url or not. If so,
get the node. Here's my code:
XmlNode n = xml.SelectSingleNode("//*[contains('" + myString + "', @url)]");
This doesn't work. I know it works against the "record" node if the XPath
is //record[......]. How can I make it to search every element node
regardless of the name?
Thanks a lot
Bob