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

Function xmlXPathPopNodeSet

ThirdParty/libxml2/vtklibxml2/xpath.c:2200–2224  ·  view source on GitHub ↗

* xmlXPathPopNodeSet: * @ctxt: an XPath parser context * * Pops a node-set from the stack, handling conversion if needed. * Check error with #xmlXPathCheckError. * * Returns the node-set */

Source from the content-addressed store, hash-verified

2198 * Returns the node-set
2199 */
2200xmlNodeSetPtr
2201xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt) {
2202 xmlXPathObjectPtr obj;
2203 xmlNodeSetPtr ret;
2204
2205 if (ctxt == NULL) return(NULL);
2206 if (ctxt->value == NULL) {
2207 xmlXPathSetError(ctxt, XPATH_INVALID_OPERAND);
2208 return(NULL);
2209 }
2210 if (!xmlXPathStackIsNodeSet(ctxt)) {
2211 xmlXPathSetTypeError(ctxt);
2212 return(NULL);
2213 }
2214 obj = valuePop(ctxt);
2215 ret = obj->nodesetval;
2216#if 0
2217 /* to fix memory leak of not clearing obj->user */
2218 if (obj->boolval && obj->user != NULL)
2219 xmlFreeNodeList((xmlNodePtr) obj->user);
2220#endif
2221 obj->nodesetval = NULL;
2222 xmlXPathReleaseObject(ctxt->context, obj);
2223 return(ret);
2224}
2225
2226/**
2227 * xmlXPathPopExternal:

Callers

nothing calls this directly

Calls 3

valuePopFunction · 0.85
xmlFreeNodeListFunction · 0.85
xmlXPathReleaseObjectFunction · 0.85

Tested by

no test coverage detected