Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xpath Wildcard (for example: "/Data/Customers/D*")

Tags:

c#

wildcard

xpath

I am selecting some nodes using XPath, and would like to use wildcards. Is this possible?

Something like the following would be useful:

foreach (XmlNode xml_node in xml_document.SelectNodes("/Data/Customers/D*"))
{
   //
}
like image 522
Nippysaurus Avatar asked Dec 10 '09 23:12

Nippysaurus


1 Answers

Try this:

/Data/Customers/*[starts-with(name(.), "D")]
like image 106
Rubens Farias Avatar answered Oct 13 '22 00:10

Rubens Farias