提交 561726cd 编写于 作者: P Pavel Hrdina

util: introduce virXMLNodeContentString

It's equivalent of calling virXPathString("string(.)", ctxt) but it
doesn't have to use the XPath resolving and parsing.
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 827cf58d
......@@ -2954,6 +2954,7 @@ virVHBAPathExists;
virXMLCheckIllegalChars;
virXMLChildElementCount;
virXMLExtractNamespaceXML;
virXMLNodeContentString;
virXMLNodeNameEqual;
virXMLNodeSanitizeNamespaces;
virXMLNodeToString;
......
......@@ -540,6 +540,22 @@ virXMLPropStringLimit(xmlNodePtr node,
}
/**
* virXMLNodeContentString:
* @node: XML dom node pointer
*
* Convenience function to return copy of content of an XML node.
*
* Returns the content value as string or NULL in case of failure.
* The caller is responsible for freeing the returned buffer.
*/
char *
virXMLNodeContentString(xmlNodePtr node)
{
return (char *)xmlNodeGetContent(node);
}
/**
* virXPathBoolean:
* @xpath: the XPath string to evaluate
......
......@@ -76,6 +76,7 @@ char * virXMLPropString(xmlNodePtr node,
char * virXMLPropStringLimit(xmlNodePtr node,
const char *name,
size_t maxlen);
char * virXMLNodeContentString(xmlNodePtr node);
long virXMLChildElementCount(xmlNodePtr node);
/* Internal function; prefer the macros below. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册