If I have an xml structure like this
<root> <sub> <node /> <node /> </sub> <sub> <node /> <sub> <sub> <sub> <node /> </sub> </sub> <sub> <sub> <sub> <node /> </sub> <node /> </sub> </sub> <node /> <node /> </root>
Is there an xpath syntax which will only select the first three levels of nodes?
so it will collect
<root> <sub> <node /> <node /> </sub> <sub /> <sub> <sub /> </sub> <sub> <sub /> </sub> <node /> <node /> </root>
UPDATE
Just to explain what I'm doing, I've got an asp:treeview, which I am binding to an asp:xmldatasource, and I want the tree view to only go three nodes deep. It may be possible to do it on the treeview or xmldatasource control another way, but the xpath seemed the most obvious
Thanks, Psy