[libvirt] [PATCH] schema: interleave domain name and uuid with other elements

Allow <name> and <uuid> anywhere under <domain>, not just at the top: error:XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng Expecting an element name, got nothing Invalid sequence in interleave Element domain failed to validate content Introduced with the first RelaxNG schema in commit c642103. https://bugzilla.redhat.com/show_bug.cgi?id=1292131 --- docs/schemas/domaincommon.rng | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 4804c69..01d99f0 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -30,8 +30,8 @@ <define name="domain"> <element name="domain"> <ref name="hvs"/> - <ref name="ids"/> <interleave> + <ref name="ids"/> <optional> <ref name="title"/> </optional> -- 2.4.6

On 17.12.2015 13:56, Ján Tomko wrote:
Allow <name> and <uuid> anywhere under <domain>, not just at the top:
error:XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng Expecting an element name, got nothing Invalid sequence in interleave Element domain failed to validate content
Introduced with the first RelaxNG schema in commit c642103.
https://bugzilla.redhat.com/show_bug.cgi?id=1292131 --- docs/schemas/domaincommon.rng | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 4804c69..01d99f0 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -30,8 +30,8 @@ <define name="domain"> <element name="domain"> <ref name="hvs"/> - <ref name="ids"/> <interleave> + <ref name="ids"/> <optional> <ref name="title"/> </optional>
This is rather tricky. I'm not against the change, but 'ids' is defined as: <optional attribute/> <interleave> <elem name/> <optional elem uuid/> </interleave> Thing is, if "ids" would ever get second in the master <interleave/> shown in your patch, the attribute might refer to a different element. But I guess that would fire plenty of failed cases in our test suite, right? ACK then. Michal

On Thu, Dec 17, 2015 at 02:18:49PM +0100, Michal Privoznik wrote:
On 17.12.2015 13:56, Ján Tomko wrote:
Allow <name> and <uuid> anywhere under <domain>, not just at the top:
error:XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng Expecting an element name, got nothing Invalid sequence in interleave Element domain failed to validate content
Introduced with the first RelaxNG schema in commit c642103.
https://bugzilla.redhat.com/show_bug.cgi?id=1292131 --- docs/schemas/domaincommon.rng | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 4804c69..01d99f0 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -30,8 +30,8 @@ <define name="domain"> <element name="domain"> <ref name="hvs"/> - <ref name="ids"/> <interleave> + <ref name="ids"/> <optional> <ref name="title"/> </optional>
This is rather tricky. I'm not against the change, but 'ids' is defined as:
<optional attribute/> <interleave> <elem name/> <optional elem uuid/> </interleave>
Thing is, if "ids" would ever get second in the master <interleave/> shown in your patch, the attribute might refer to a different element. But I guess that would fire plenty of failed cases in our test suite, right?
ACK then.
IMHO, we could just inline the 'ids' content in this caller - there's no real benefit in having a separate "ids" define, and the clear downside that you mention Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Thu, Dec 17, 2015 at 01:28:28PM +0000, Daniel P. Berrange wrote:
On Thu, Dec 17, 2015 at 02:18:49PM +0100, Michal Privoznik wrote:
On 17.12.2015 13:56, Ján Tomko wrote:
[...]
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 4804c69..01d99f0 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -30,8 +30,8 @@ <define name="domain"> <element name="domain"> <ref name="hvs"/> - <ref name="ids"/> <interleave> + <ref name="ids"/> <optional> <ref name="title"/> </optional>
This is rather tricky. I'm not against the change, but 'ids' is defined as:
<optional attribute/> <interleave> <elem name/> <optional elem uuid/> </interleave>
Thing is, if "ids" would ever get second in the master <interleave/> shown in your patch, the attribute might refer to a different element.
The order in interleave does not matter. The attribute refers to the parent element, not the last mentioned element. Or did you mean something else?
But I guess that would fire plenty of failed cases in our test suite, right?
IIUC that would be a loosening of the schema, so it would probably not.
ACK then.
IMHO, we could just inline the 'ids' content in this caller - there's no real benefit in having a separate "ids" define, and the clear downside that you mention
I have no objections to inlining it, I just don't see the downside. Jan
participants (3)
-
Daniel P. Berrange
-
Ján Tomko
-
Michal Privoznik