* xmlXPathCompOpEvalPredicate: * @ctxt: the XPath Parser context * @op: the predicate op * @set: the node set to filter * @minPos: minimum position in the filtered set (1-based) * @maxPos: maximum position in the filtered set (1-based) * @hasNsNodes: true if the node set may contain namespace nodes * * Filter a node set, keeping only nodes for which the sequence of predicate * expression
| 10721 | * in the filtered result. |
| 10722 | */ |
| 10723 | static void |
| 10724 | xmlXPathCompOpEvalPredicate(xmlXPathParserContextPtr ctxt, |
| 10725 | xmlXPathStepOpPtr op, |
| 10726 | xmlNodeSetPtr set, |
| 10727 | int minPos, int maxPos, |
| 10728 | int hasNsNodes) |
| 10729 | { |
| 10730 | if (op->ch1 != -1) { |
| 10731 | xmlXPathCompExprPtr comp = ctxt->comp; |
| 10732 | /* |
| 10733 | * Process inner predicates first. |
| 10734 | */ |
| 10735 | if (comp->steps[op->ch1].op != XPATH_OP_PREDICATE) { |
| 10736 | XP_ERROR(XPATH_INVALID_OPERAND); |
| 10737 | } |
| 10738 | if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH) |
| 10739 | XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED); |
| 10740 | ctxt->context->depth += 1; |
| 10741 | xmlXPathCompOpEvalPredicate(ctxt, &comp->steps[op->ch1], set, |
| 10742 | 1, set->nodeNr, hasNsNodes); |
| 10743 | ctxt->context->depth -= 1; |
| 10744 | CHECK_ERROR; |
| 10745 | } |
| 10746 | |
| 10747 | if (op->ch2 != -1) |
| 10748 | xmlXPathNodeSetFilter(ctxt, set, op->ch2, minPos, maxPos, hasNsNodes); |
| 10749 | } |
| 10750 | |
| 10751 | static int |
| 10752 | xmlXPathIsPositionalPredicate(xmlXPathParserContextPtr ctxt, |
no test coverage detected