How to select nodes by attribute that starts with... in C#
c#, xml
Solution
The simple `starts-with` function does what you need:
parentNode.SelectNodes("//table/tr/td/a[starts-with(@href, '/employees/')]")
Problem
I have this xml document and I want to select nodes by attribute that starts with '/employees/'. ``` <table> <tr> <td> <a href="/employees/1.html" title="Employee 1">Employee 1</a> </td> <td>Robert</td> </tr> <tr> <td> <a href="/employees/2.html" title="Employee 2">Employee 2</a> </td> <td>Jennifer</td> </tr> </table> ``` So in C#, I would do something like this: ``` parentNode.SelectNodes("//table/tr/th/a[@href='/employees/.....']") ``` Is this possible with C#? Thanks!