[1 or 2] also evaluates the "always true" predicate in .Net, so this behavior seems consistent:
Here is the output from XPath.NET 3.5 XmlDocument
// Returns first, second var ndl = dom.SelectNodes(@"/root/a[position()=1 or position()=2]"); // Returns first, second and third ndl = dom.SelectNodes(@"/root/a[1 or 2]"); // Returns first, second ndl = dom.SelectNodes(@"/root/a[1] | /root/a[2]");
Edit
In XPath 2, you can use the index-of and exists sequence functions to determine if a given position is contained in a sequence of values:
/root/a[exists(index-of((1,2), position()))]
source share