XPath to select nodes whose name starts with



I have XML that looks like this:



<detail>
<address>
<line1/>
<line2/>
<line3/>
<postcode/>
</address>
</detail/>


There could be any number of <line*> nodes which I want to select, and other nodes which I don't want to select.


I have tried this, which doesn't seem to work (in C# anyway):



/detail/address/[substring(name(),4) = 'line']


Al, help appreciated!


No comments:

Post a Comment