* xmlXPathPositionFunction: * @ctxt: the XPath Parser context * @nargs: the number of arguments * * Implement the position() XPath function * number position() * The position function returns the position of the context node in the * context node list. The first position is 1, and so the last position * will be equal to last(). */
| 7446 | * will be equal to last(). |
| 7447 | */ |
| 7448 | void |
| 7449 | xmlXPathPositionFunction(xmlXPathParserContextPtr ctxt, int nargs) { |
| 7450 | CHECK_ARITY(0); |
| 7451 | if (ctxt->context->proximityPosition >= 0) { |
| 7452 | valuePush(ctxt, xmlXPathCacheNewFloat(ctxt, |
| 7453 | (double) ctxt->context->proximityPosition)); |
| 7454 | } else { |
| 7455 | XP_ERROR(XPATH_INVALID_CTXT_POSITION); |
| 7456 | } |
| 7457 | } |
| 7458 | |
| 7459 | /** |
| 7460 | * xmlXPathCountFunction: |
nothing calls this directly
no test coverage detected