MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlXPathNodeSetKeepLast

Function xmlXPathNodeSetKeepLast

ThirdParty/libxml2/vtklibxml2/xpath.c:3361–3377  ·  view source on GitHub ↗

* xmlXPathNodeSetKeepLast: * @set: the node set to be cleared * * Move the last node to the first position and clear temporary XPath objects * (e.g. namespace nodes) from all other nodes. Sets the length of the list * to 1. */

Source from the content-addressed store, hash-verified

3359 * to 1.
3360 */
3361static void
3362xmlXPathNodeSetKeepLast(xmlNodeSetPtr set)
3363{
3364 int i;
3365 xmlNodePtr node;
3366
3367 if ((set == NULL) || (set->nodeNr <= 1))
3368 return;
3369 for (i = 0; i < set->nodeNr - 1; i++) {
3370 node = set->nodeTab[i];
3371 if ((node != NULL) &&
3372 (node->type == XML_NAMESPACE_DECL))
3373 xmlXPathNodeSetFreeNs((xmlNsPtr) node);
3374 }
3375 set->nodeTab[0] = set->nodeTab[set->nodeNr-1];
3376 set->nodeNr = 1;
3377}
3378
3379/**
3380 * xmlXPathNewNodeSet:

Callers 2

xmlXPathCompOpEvalFunction · 0.85

Calls 1

xmlXPathNodeSetFreeNsFunction · 0.85

Tested by

no test coverage detected