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

Function xmlSchematronGetNode

ThirdParty/libxml2/vtklibxml2/schematron.c:1417–1438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1415 ************************************************************************/
1416
1417static xmlNodePtr
1418xmlSchematronGetNode(xmlSchematronValidCtxtPtr ctxt,
1419 xmlNodePtr cur, const xmlChar *xpath) {
1420 xmlNodePtr node = NULL;
1421 xmlXPathObjectPtr ret;
1422
1423 if ((ctxt == NULL) || (cur == NULL) || (xpath == NULL))
1424 return(NULL);
1425
1426 ctxt->xctxt->doc = cur->doc;
1427 ctxt->xctxt->node = cur;
1428 ret = xmlXPathEval(xpath, ctxt->xctxt);
1429 if (ret == NULL)
1430 return(NULL);
1431
1432 if ((ret->type == XPATH_NODESET) &&
1433 (ret->nodesetval != NULL) && (ret->nodesetval->nodeNr > 0))
1434 node = ret->nodesetval->nodeTab[0];
1435
1436 xmlXPathFreeObject(ret);
1437 return(node);
1438}
1439
1440/**
1441 * xmlSchematronReportOutput:

Callers 1

Calls 2

xmlXPathEvalFunction · 0.85
xmlXPathFreeObjectFunction · 0.85

Tested by

no test coverage detected