提交 7c3534e0 编写于 作者: J Ján Tomko

util: introduce virXMLNamespaceFormatNS

A function to automatically format the xmlns:<prefix>='<uri>'
attribute for per-driver namespaces.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
上级 5802dec1
...@@ -1408,3 +1408,11 @@ virXPathContextNodeRestore(virXPathContextNodeSavePtr save) ...@@ -1408,3 +1408,11 @@ virXPathContextNodeRestore(virXPathContextNodeSavePtr save)
save->ctxt->node = save->node; save->ctxt->node = save->node;
} }
void
virXMLNamespaceFormatNS(virBufferPtr buf,
virXMLNamespace const *ns)
{
virBufferAsprintf(buf, " xmlns:%s='%s'", ns->prefix, ns->href());
}
...@@ -261,3 +261,7 @@ struct _virXMLNamespace { ...@@ -261,3 +261,7 @@ struct _virXMLNamespace {
}; };
typedef struct _virXMLNamespace virXMLNamespace; typedef struct _virXMLNamespace virXMLNamespace;
typedef virXMLNamespace *virXMLNamespacePtr; typedef virXMLNamespace *virXMLNamespacePtr;
void
virXMLNamespaceFormatNS(virBufferPtr buf,
virXMLNamespace const *ns);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册