#include <math.h> /* for isnan() */
#include <sys/stat.h>
+#include <libxml/xpathInternals.h>
+
#include "virerror.h"
#include "virxml.h"
#include "virbuffer.h"
{
virBufferAsprintf(buf, " xmlns:%s='%s'", ns->prefix, ns->href());
}
+
+
+int
+virXMLNamespaceRegister(xmlXPathContextPtr ctxt,
+ virXMLNamespace const *ns)
+{
+ if (xmlXPathRegisterNs(ctxt,
+ BAD_CAST ns->prefix,
+ BAD_CAST ns->href()) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to register xml namespace '%s'"),
+ ns->href());
+ return -1;
+ }
+
+ return 0;
+}
void
virXMLNamespaceFormatNS(virBufferPtr buf,
virXMLNamespace const *ns);
+int
+virXMLNamespaceRegister(xmlXPathContextPtr ctxt,
+ virXMLNamespace const *ns);