xml_get_node_by_xpath.c File Reference

Get XML setting element node. More...

#include <xml_utils.h>
Include dependency graph for xml_get_node_by_xpath.c:

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.

Detailed Description

Get XML setting element node.

Definition in file xml_get_node_by_xpath.c.


Function Documentation

xmlNodePtr xml_get_node_by_xpath ( xmlConfig_t conf,
char *  path 
)

Get XML setting element node.

Parameters:
[in] conf XML information for DOM and XPath
[in] path path for XPath
Returns:
DOM Node pointer

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 }


Generated on 12 May 2016 for DSCLIM by  doxygen 1.6.1