#include <crm_internal.h>
#include <stdio.h>
#include <string.h>
#include <crm/msg_xml.h>
#include <crm/common/xml_internal.h>
#include "crmcommon_private.h"
#include <crm/common/xml_compat.h>
Go to the source code of this file.
|
void | freeXpathObject (xmlXPathObjectPtr xpathObj) |
|
xmlNode * | getXpathResult (xmlXPathObjectPtr xpathObj, int index) |
|
void | dedupXpathResults (xmlXPathObjectPtr xpathObj) |
|
xmlXPathObjectPtr | xpath_search (const xmlNode *xml_top, const char *path) |
|
void | crm_foreach_xpath_result (xmlNode *xml, const char *xpath, void(*helper)(xmlNode *, void *), void *user_data) |
| Run a supplied function for each result of an xpath search. More...
|
|
xmlNode * | get_xpath_object_relative (const char *xpath, xmlNode *xml_obj, int error_level) |
|
xmlNode * | get_xpath_object (const char *xpath, xmlNode *xml_obj, int error_level) |
|
GString * | pcmk__element_xpath (const xmlNode *xml) |
|
char * | pcmk__xpath_node_id (const char *xpath, const char *node) |
|
char * | xml_get_path (const xmlNode *xml) |
| Get an XPath string that matches an XML element as closely as possible. More...
|
|
◆ crm_foreach_xpath_result()
void crm_foreach_xpath_result |
( |
xmlNode * |
xml, |
|
|
const char * |
xpath, |
|
|
void(*)(xmlNode *, void *) |
helper, |
|
|
void * |
user_data |
|
) |
| |
Run a supplied function for each result of an xpath search.
- Parameters
-
[in,out] | xml | XML to search |
[in] | xpath | XPath search string |
[in] | helper | Function to call for each result |
[in,out] | user_data | Data to pass to supplied function |
- Note
- The helper function will be passed the XML node of the result, and the supplied user_data. This function does not otherwise use user_data.
Definition at line 170 of file xpath.c.
◆ dedupXpathResults()
void dedupXpathResults |
( |
xmlXPathObjectPtr |
xpathObj | ) |
|
◆ freeXpathObject()
void freeXpathObject |
( |
xmlXPathObjectPtr |
xpathObj | ) |
|
◆ get_xpath_object()
xmlNode* get_xpath_object |
( |
const char * |
xpath, |
|
|
xmlNode * |
xml_obj, |
|
|
int |
error_level |
|
) |
| |
◆ get_xpath_object_relative()
xmlNode* get_xpath_object_relative |
( |
const char * |
xpath, |
|
|
xmlNode * |
xml_obj, |
|
|
int |
error_level |
|
) |
| |
◆ getXpathResult()
xmlNode* getXpathResult |
( |
xmlXPathObjectPtr |
xpathObj, |
|
|
int |
index |
|
) |
| |
◆ pcmk__element_xpath()
GString* pcmk__element_xpath |
( |
const xmlNode * |
xml | ) |
|
◆ pcmk__xpath_node_id()
char* pcmk__xpath_node_id |
( |
const char * |
xpath, |
|
|
const char * |
node |
|
) |
| |
◆ xml_get_path()
char* xml_get_path |
( |
const xmlNode * |
xml | ) |
|
Get an XPath string that matches an XML element as closely as possible.
- Deprecated:
- This function will be removed in a future release
- Parameters
-
[in] | xml | The XML element for which to build an XPath string |
- Returns
- A string that matches
xml
, or NULL
if xml
is NULL
.
- Note
- The caller is responsible for freeing the string using free().
Definition at line 358 of file xpath.c.
◆ xpath_search()
xmlXPathObjectPtr xpath_search |
( |
const xmlNode * |
xml_top, |
|
|
const char * |
path |
|
) |
| |