[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 09/21] xml: virXMLNamespace: add prefix



On Wed, Aug 21, 2019 at 01:15:31 +0200, Ján Tomko wrote:
> 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>
> ---
>  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;

Reviewed-by: Jiri Denemark <jdenemar redhat com>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]