Get XML setting element node. More...
#include <xml_utils.h>
Go to the source code of this file.
Functions | |
xmlNodePtr | xml_get_node_by_xpath (xmlConfig_t *conf, char *path) |
Get XML setting element node. |
Get XML setting element node.
Definition in file xml_get_node_by_xpath.c.
xmlNodePtr xml_get_node_by_xpath | ( | xmlConfig_t * | conf, | |
char * | path | |||
) |
Get XML setting element node.
[in] | conf | XML information for DOM and XPath |
[in] | path | path for XPath |
Definition at line 58 of file xml_get_node_by_xpath.c.
References xmlConfig_t::ctxt.
Referenced by xml_get_setting().
00058 { 00066 xmlXPathObjectPtr xpathRes; 00067 xmlNodePtr nodeptr = NULL; 00068 00069 /* Evaluate XPath expression */ 00070 xpathRes = xmlXPathEvalExpression((unsigned char *) path, conf->ctxt); 00071 00072 if (xpathRes) 00073 if (xpathRes->nodesetval) { 00074 00075 if (xpathRes->type == XPATH_NODESET && xpathRes->nodesetval->nodeNr == 1) 00076 nodeptr = xpathRes->nodesetval->nodeTab[0]; 00077 (void) xmlXPathFreeObject(xpathRes); 00078 00079 } 00080 00081 return nodeptr; 00082 }