We have hardcoded the namespace prefix in various places:
1) the xmlns string stored in the 'href' function
2) the xmlXPathRegisterNs call in each parser
3) all the parsing and formatting code actually dealing
   with these elements

While eliminating the third one is probably a job for an
actual XML-aware formatter, let's store the prefix separately
here in the virXMLNamespace structure so that future patches
can get rid of the first two bullets.

Signed-off-by: Ján Tomko <jto...@redhat.com>
---
 src/util/virxml.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/util/virxml.h b/src/util/virxml.h
index 5b209bb040..ea0c3d3ab3 100644
--- a/src/util/virxml.h
+++ b/src/util/virxml.h
@@ -256,6 +256,7 @@ struct _virXMLNamespace {
     virXMLNamespaceParse parse;
     virXMLNamespaceFree free;
     virXMLNamespaceFormat format;
+    const char *prefix;
     virXMLNamespaceHref href;
 };
 typedef struct _virXMLNamespace virXMLNamespace;
-- 
2.19.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to