]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: Allow validation for single XML node
authorTim Wiederhake <twiederh@redhat.com>
Wed, 30 Sep 2020 11:55:02 +0000 (13:55 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 7 Oct 2020 07:18:07 +0000 (09:18 +0200)
commit9faa31ce79f1f63ba091a9a8edd8b7c54395ee10
treee891990aee5417f19bd9f6c515a5b25061a6deea
parent5d325240c645ea6c1a0902c695cf299410b1f90c
util: Allow validation for single XML node

Validation is usually performed on an entire document. If we are only
interested in validating a single nested node that can occur in
different contexts, this would require writing different schemas for
any of those different contexts.

By temporarily replacing the document's root node, we can validate the
relevant node only.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/util/virxml.c
src/util/virxml.h