I want to limit number of result I receive from xpath query.
For example:-
$info = $xml->xpath(\"//*[firstname=\'Sheila\'] **LIMIT 0,100**\");
>
Ran into the same issue myself and had some issue with Geoffs answer as it, as he clearly describes, limits the number of elements returned before it performs the other parts of the query due to precedence.
My solution is to add the position() < 10 as an additional conditional after my other conditions have been applied e.g.:
//ElementsIWant[./ChildElementToFilterOn='ValueToSearchFor'][position() <= 10]/.
Notice that I'm using two separate conditional blocks. This will first filter out elements that live up to my condition and secondly only take 10 of those.