XPath and SelectNodes

Topics: Developer Forum
Jul 26, 2013 at 9:02 AM
Why did the function SelectNodes from any element starts looking from DocumentNode not from the current element? Is it have any backlashes?
Aug 9, 2013 at 10:21 AM
Edited Aug 19, 2013 at 4:58 PM
Yes, faced with same issue. It looks a bug..
Aug 9, 2013 at 10:28 AM
Maybe we can fix it somehow? In my opinion it is quite straightforward. But I can be wrong.
Aug 19, 2013 at 4:01 PM
I suppose that this project is based on xml. So you should just SelectNodes('.//Field') instead of SelectNodes('//Field') to search relative to current path.

source: http://stackoverflow.com/questions/7143629/xpath-expression-to-select-all-nodes
Aug 19, 2013 at 4:58 PM
gooleem wrote:
I suppose that this project is based on xml. So you should just SelectNodes('.//Field') instead of SelectNodes('//Field') to search relative to current path.

source: http://stackoverflow.com/questions/7143629/xpath-expression-to-select-all-nodes
Yes, you are right, it works for me.