]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
xml: virXMLNamespace: add prefix
authorJán Tomko <jtomko@redhat.com>
Tue, 20 Aug 2019 22:03:15 +0000 (00:03 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 21 Aug 2019 08:29:20 +0000 (10:29 +0200)
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 <jtomko@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/util/virxml.h

index c0012d691d31cca0948a00e59ea047112475fc0b..61520968aeec8fc7776752637c039dc58b638042 100644 (file)
@@ -256,6 +256,7 @@ struct _virXMLNamespace {
     virXMLNamespaceParse parse;
     virXMLNamespaceFree free;
     virXMLNamespaceFormat format;
+    const char *prefix;
     virXMLNamespaceHref href;
 };
 typedef struct _virXMLNamespace virXMLNamespace;