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

Function xmlXPathNodeSetClearFromPos

ThirdParty/libxml2/vtklibxml2/xpath.c:3320–3337  ·  view source on GitHub ↗

* xmlXPathNodeSetClearFromPos: * @set: the node set to be cleared * @pos: the start position to clear from * * Clears the list from temporary XPath objects (e.g. namespace nodes * are feed) starting with the entry at @pos, but does *not* free the list * itself. Sets the length of the list to @pos. */

Source from the content-addressed store, hash-verified

3318 * itself. Sets the length of the list to @pos.
3319 */
3320static void
3321xmlXPathNodeSetClearFromPos(xmlNodeSetPtr set, int pos, int hasNsNodes)
3322{
3323 if ((set == NULL) || (pos >= set->nodeNr))
3324 return;
3325 else if ((hasNsNodes)) {
3326 int i;
3327 xmlNodePtr node;
3328
3329 for (i = pos; i < set->nodeNr; i++) {
3330 node = set->nodeTab[i];
3331 if ((node != NULL) &&
3332 (node->type == XML_NAMESPACE_DECL))
3333 xmlXPathNodeSetFreeNs((xmlNsPtr) node);
3334 }
3335 }
3336 set->nodeNr = pos;
3337}
3338
3339/**
3340 * xmlXPathNodeSetClear:

Callers 2

xmlXPathNodeSetClearFunction · 0.85
xmlXPathCompOpEvalFunction · 0.85

Calls 1

xmlXPathNodeSetFreeNsFunction · 0.85

Tested by

no test coverage detected