[xml] Making xmlXPathEvalExpression only report "enough" matches


I'm using libxml2, and its XPath features in particular. When I invoke 

        xmlXPathObjectPtr xobj = xmlXPathEvalExpression(AsXMLchar(_expression.c_str()), ctx);


        xmlNodeSetPtr nodes = xobj->nodesetval;

gives me the set of all matches to my XPath expression. However, I use this in a piece of software where 
speed is rather important, and I don't really need all the matches. I only need the first n matches, where n 
is some configurable number.

Is there a way to make xmlXPathEvalExpression return when "enough" matches have been found, instead of having 
it return all matches? If yes, how?

Thanks in advance,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]