| 103 | */ |
| 104 | |
| 105 | const char *msLibXml2GetXPathTree(xmlDocPtr doc, xmlXPathObjectPtr xpath) { |
| 106 | xmlBufferPtr xbuf; |
| 107 | const char *result = NULL; |
| 108 | |
| 109 | xbuf = xmlBufferCreate(); |
| 110 | |
| 111 | if (xpath) { |
| 112 | if (xmlNodeDump(xbuf, doc, xpath->nodesetval->nodeTab[0], 0, 0) == -1) { |
| 113 | return NULL; |
| 114 | } |
| 115 | result = msStrdup((char *)xbuf->content); |
| 116 | } |
| 117 | xmlBufferFree(xbuf); |
| 118 | return result; |
| 119 | } |
| 120 | |
| 121 | #endif /* defined(USE_LIBXML2) */ |
no test coverage detected