the caller needs to check if the result contains a xmlDocPtr or xmlNodePtr */
| 2746 | |
| 2747 | /* the caller needs to check if the result contains a xmlDocPtr or xmlNodePtr */ |
| 2748 | xmlXPathObjectPtr |
| 2749 | xpath_search(xmlNode *xml_top, const char *path) |
| 2750 | { |
| 2751 | xmlDocPtr doc = NULL; |
| 2752 | xmlXPathObjectPtr xpathObj = NULL; |
| 2753 | xmlXPathContextPtr xpathCtx = NULL; |
| 2754 | const xmlChar *xpathExpr = (const xmlChar *)path; |
| 2755 | |
| 2756 | CRM_CHECK(path != NULL, return NULL); |
| 2757 | CRM_CHECK(xml_top != NULL, return NULL); |
| 2758 | CRM_CHECK(strlen(path) > 0, return NULL); |
| 2759 | |
| 2760 | doc = getDocPtr(xml_top); |
| 2761 | |
| 2762 | crm_trace("Evaluating: %s", path); |
| 2763 | xpathCtx = xmlXPathNewContext(doc); |
| 2764 | CRM_ASSERT(xpathCtx != NULL); |
| 2765 | |
| 2766 | xpathObj = xmlXPathEvalExpression(xpathExpr, xpathCtx); |
| 2767 | xmlXPathFreeContext(xpathCtx); |
| 2768 | return xpathObj; |
| 2769 | } |
| 2770 | |
| 2771 | gboolean |
| 2772 | cli_config_update(xmlNode **xml, int *best_version, gboolean to_logs) |
no test coverage detected