| 1415 | ************************************************************************/ |
| 1416 | |
| 1417 | static xmlNodePtr |
| 1418 | xmlSchematronGetNode(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: |
no test coverage detected