[xml] New function xmlXPathCompiledEvalIsTrue()



Hi,

I'd like to add the following public function to xpath.h. It will
evaluate an expression and convert it internally to a boolean result.
This will spare the need of exchanging an XPath boolean object, plus
the evaluation can be optimized to stop at the first sign
of a positive result.

/**
 * xmlXPathCompiledEvalIsTrue:
 * @comp:  the compiled XPath expression
 * @ctxt:  the XPath context
 *
 * Evaluates the given compiled expression and applies the XPath
boolean()
 * function on the result.
 *
 * Returns 1 if the expression evaluated to true, 0 if to false and
 *         -1 on API and internal errors.
 */
int xmlXPathCompiledEvalIsTrue(xmlXPathCompExprPtr comp,
  xmlXPathContextPtr ctxt);

Any cons?

Regards,

Kasimier



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