| 279 | PG_FUNCTION_INFO_V1(xpath_list); |
| 280 | |
| 281 | Datum |
| 282 | xpath_list(PG_FUNCTION_ARGS) |
| 283 | { |
| 284 | text *document = PG_GETARG_TEXT_PP(0); |
| 285 | text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */ |
| 286 | xmlChar *plainsep = pgxml_texttoxmlchar(PG_GETARG_TEXT_PP(2)); |
| 287 | xmlChar *xpath; |
| 288 | text *xpres; |
| 289 | xmlXPathObjectPtr res; |
| 290 | xpath_workspace workspace; |
| 291 | |
| 292 | xpath = pgxml_texttoxmlchar(xpathsupp); |
| 293 | |
| 294 | res = pgxml_xpath(document, xpath, &workspace); |
| 295 | |
| 296 | xpres = pgxml_result_to_text(res, NULL, NULL, plainsep); |
| 297 | |
| 298 | cleanup_workspace(&workspace); |
| 299 | |
| 300 | pfree(xpath); |
| 301 | |
| 302 | if (xpres == NULL) |
| 303 | PG_RETURN_NULL(); |
| 304 | PG_RETURN_TEXT_P(xpres); |
| 305 | } |
| 306 | |
| 307 | |
| 308 | PG_FUNCTION_INFO_V1(xpath_string); |
nothing calls this directly
no test coverage detected