From 2e2710caffccf85e65353022fb6815d4eb23299e Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Tomko?= Date: Wed, 21 Aug 2019 00:03:15 +0200 Subject: [PATCH] xml: virXMLNamespace: add prefix MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jiri Denemark --- src/util/virxml.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/virxml.h b/src/util/virxml.h index c0012d691d..61520968ae 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.47.2