diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:45:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:45:40 +0000 |
commit | 07d7f4cfa4b10de87a31b68191036ff446add675 (patch) | |
tree | 7162524d8aaf1aef62d2f4fa51f595ed113981ff /lib/common/xpath.c | |
parent | Adding upstream version 2.1.6. (diff) | |
download | pacemaker-upstream/2.1.7.tar.xz pacemaker-upstream/2.1.7.zip |
Adding upstream version 2.1.7.upstream/2.1.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/common/xpath.c')
-rw-r--r-- | lib/common/xpath.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/common/xpath.c b/lib/common/xpath.c index 1f5c0a8..d90f1c5 100644 --- a/lib/common/xpath.c +++ b/lib/common/xpath.c @@ -1,5 +1,5 @@ /* - * Copyright 2004-2022 the Pacemaker project contributors + * Copyright 2004-2023 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -136,9 +136,8 @@ dedupXpathResults(xmlXPathObjectPtr xpathObj) /* the caller needs to check if the result contains a xmlDocPtr or xmlNodePtr */ xmlXPathObjectPtr -xpath_search(xmlNode * xml_top, const char *path) +xpath_search(const xmlNode *xml_top, const char *path) { - xmlDocPtr doc = NULL; xmlXPathObjectPtr xpathObj = NULL; xmlXPathContextPtr xpathCtx = NULL; const xmlChar *xpathExpr = (pcmkXmlStr) path; @@ -147,9 +146,7 @@ xpath_search(xmlNode * xml_top, const char *path) CRM_CHECK(xml_top != NULL, return NULL); CRM_CHECK(strlen(path) > 0, return NULL); - doc = getDocPtr(xml_top); - - xpathCtx = xmlXPathNewContext(doc); + xpathCtx = xmlXPathNewContext(xml_top->doc); CRM_ASSERT(xpathCtx != NULL); xpathObj = xmlXPathEvalExpression(xpathExpr, xpathCtx); @@ -298,9 +295,9 @@ pcmk__element_xpath(const xmlNode *xml) if (parent == NULL) { g_string_append_c(xpath, '/'); } else if (parent->parent == NULL) { - g_string_append(xpath, TYPE(xml)); + g_string_append(xpath, (const gchar *) xml->name); } else { - pcmk__g_strcat(xpath, "/", TYPE(xml), NULL); + pcmk__g_strcat(xpath, "/", (const char *) xml->name, NULL); } id = ID(xml); |