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

Function xpath_bool

contrib/xml2/xpath.c:383–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381PG_FUNCTION_INFO_V1(xpath_bool);
382
383Datum
384xpath_bool(PG_FUNCTION_ARGS)
385{
386 text *document = PG_GETARG_TEXT_PP(0);
387 text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */
388 xmlChar *xpath;
389 int bRes;
390 xmlXPathObjectPtr res;
391 xpath_workspace workspace;
392
393 xpath = pgxml_texttoxmlchar(xpathsupp);
394
395 res = pgxml_xpath(document, xpath, &workspace);
396
397 pfree(xpath);
398
399 if (res == NULL)
400 PG_RETURN_BOOL(false);
401
402 bRes = xmlXPathCastToBoolean(res);
403
404 cleanup_workspace(&workspace);
405
406 PG_RETURN_BOOL(bRes);
407}
408
409
410

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected