MCPcopy Create free account
hub / github.com/apache/cloudberry / xpath_list

Function xpath_list

contrib/xml2/xpath.c:281–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279PG_FUNCTION_INFO_V1(xpath_list);
280
281Datum
282xpath_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
308PG_FUNCTION_INFO_V1(xpath_string);

Callers

nothing calls this directly

Calls 5

pgxml_texttoxmlcharFunction · 0.85
pgxml_xpathFunction · 0.85
pgxml_result_to_textFunction · 0.85
cleanup_workspaceFunction · 0.85
pfreeFunction · 0.50

Tested by

no test coverage detected