| 78 | */ |
| 79 | |
| 80 | xmlXPathObjectPtr msLibXml2GetXPath(xmlDocPtr doc, xmlXPathContextPtr context, xmlChar *xpath) { |
| 81 | xmlXPathObjectPtr result; |
| 82 | result = xmlXPathEval(xpath, context); |
| 83 | if (result == NULL) { |
| 84 | return NULL; |
| 85 | } |
| 86 | if(xmlXPathNodeSetIsEmpty(result->nodesetval)){ |
| 87 | xmlXPathFreeObject(result); |
| 88 | return NULL; |
| 89 | } |
| 90 | return result; |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * msLibXml2GetXPathTree |