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

Function doXPathQuery

ThirdParty/libxml2/vtklibxml2/xmllint.c:2085–2106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2083}
2084
2085static void doXPathQuery(xmlDocPtr doc, const char *query) {
2086 xmlXPathContextPtr ctxt;
2087 xmlXPathObjectPtr res;
2088
2089 ctxt = xmlXPathNewContext(doc);
2090 if (ctxt == NULL) {
2091 fprintf(ERR_STREAM, "Out of memory for XPath\n");
2092 progresult = XMLLINT_ERR_MEM;
2093 return;
2094 }
2095 ctxt->node = (xmlNodePtr) doc;
2096 res = xmlXPathEval(BAD_CAST query, ctxt);
2097 xmlXPathFreeContext(ctxt);
2098
2099 if (res == NULL) {
2100 fprintf(ERR_STREAM, "XPath evaluation failure\n");
2101 progresult = XMLLINT_ERR_XPATH;
2102 return;
2103 }
2104 doXPathDump(res);
2105 xmlXPathFreeObject(res);
2106}
2107#endif /* LIBXML_XPATH_ENABLED */
2108
2109/************************************************************************

Callers 1

parseAndPrintFileFunction · 0.85

Calls 6

xmlXPathNewContextFunction · 0.85
fprintfFunction · 0.85
xmlXPathEvalFunction · 0.85
xmlXPathFreeContextFunction · 0.85
doXPathDumpFunction · 0.85
xmlXPathFreeObjectFunction · 0.85

Tested by

no test coverage detected