mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +00:00
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: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
827cf58d50
commit
561726cd7f
@ -2954,6 +2954,7 @@ virVHBAPathExists;
|
|||||||
virXMLCheckIllegalChars;
|
virXMLCheckIllegalChars;
|
||||||
virXMLChildElementCount;
|
virXMLChildElementCount;
|
||||||
virXMLExtractNamespaceXML;
|
virXMLExtractNamespaceXML;
|
||||||
|
virXMLNodeContentString;
|
||||||
virXMLNodeNameEqual;
|
virXMLNodeNameEqual;
|
||||||
virXMLNodeSanitizeNamespaces;
|
virXMLNodeSanitizeNamespaces;
|
||||||
virXMLNodeToString;
|
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:
|
* virXPathBoolean:
|
||||||
* @xpath: the XPath string to evaluate
|
* @xpath: the XPath string to evaluate
|
||||||
|
@ -76,6 +76,7 @@ char * virXMLPropString(xmlNodePtr node,
|
|||||||
char * virXMLPropStringLimit(xmlNodePtr node,
|
char * virXMLPropStringLimit(xmlNodePtr node,
|
||||||
const char *name,
|
const char *name,
|
||||||
size_t maxlen);
|
size_t maxlen);
|
||||||
|
char * virXMLNodeContentString(xmlNodePtr node);
|
||||||
long virXMLChildElementCount(xmlNodePtr node);
|
long virXMLChildElementCount(xmlNodePtr node);
|
||||||
|
|
||||||
/* Internal function; prefer the macros below. */
|
/* Internal function; prefer the macros below. */
|
||||||
|
Loading…
Reference in New Issue
Block a user