I am calling DocumentNode.SelectNodes with an xpath query that returns a number of rows. A simple example might be //div.
If I qualify the xpath expression to be //div I would expect only the first node to be returned. In reality the  is ignored and I still get all the nodes. //div on the other hand returns no nodes.
In a similar vain, //div[(last()] has no effect and all nodes are returned.
I am using the release version of the software. Has anyone fixed this problem or can advise me of a work around?
I though I would verify what the Microsoft System.Xml namespace would do regarding predicates. I discoved the following:
Given a document:
//div returns 1, 1a, 1b, 1c,2,3
//div returns 1,1a
//div[position()=1] returns 1,1a
//div[last()] returns 1c,3
Now to the best of my knowledge this is incorrect, as it is applying the predicate to each level in the structure, rather than applying it to the whole resultset.
Given the "bug" exists in the default Microsoft namespaces I am guessing it is unreasonable to expect HtmlAgilityPack to behave differently.
Any views greatfully received.