Bug 974650 - libvirt schemas are not valid relaxng
libvirt schemas are not valid relaxng
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
All All
unspecified Severity medium
: ---
: ---
Assigned To: Libvirt Maintainers
Depends On:
  Show dependency treegraph
Reported: 2013-06-14 13:35 EDT by Susana Cabaço
Modified: 2013-06-17 04:20 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-06-14 17:03:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Susana Cabaço 2013-06-14 13:35:10 EDT
Description of problem:

While trying to take the libvirt relaxng schemas and get java classes from them, no matter the approach and auxiliary tool I would use, it would fail.

My particular problem was related with producing an xml configuration file representing a virtual machine. Later on this file would be used in an operation that registers a machine into a hypervisor in order to be able to (for example) power it on.

My original idea was to transform relaxng into xmlschema and then use jaxb to create the java classes as java's xjc support to relaxng is still experimental.
Tried relaxer and trang, this is not really working.

Then, decided to use xjc experimental support to generate java classes directly from relaxng schemas. Again, errors.

Version-Release number of selected component (if applicable):

latest version taken from git: http://libvirt.org/git/?p=libvirt.git;a=tree;f=docs/schemas;h=05ad5bb1695c317e05b9d599f34667030e1ced7f;hb=HEAD

How reproducible:

Try to generate java classes from relaxng by running:

xjc -relaxng basictypes.rng (for example. The same problem applies to all schemas)

Steps to Reproduce:

Actual results:

[ERROR] datatype library "w3.org/2001/XMLSchema-datatypes"; not recognized line 7 of file:/home/susana/workspace/myProjs/libvirtschemas/rng/basictypes.rng

And a wide list of similar errors.

Expected results:

A set of compliant java classes.

Additional info:

Take the schemas and validate them using validator.nu web service (which uses Jing at the backend) to validate a random XML document against this schema. This produced a "Missing start element." error, which according to the RELAX NG tutorial is a required child element of <grammar/>. So it looks like at least this particular version of this particular schema is invalid RELAX NG.

I am not sure this will be the only issue, it is the first one that stops anything else from happening.
Comment 1 Dave Allan 2013-06-14 16:41:28 EDT
Hey DV, since you're the resident XML expert, can you weigh in here?
Comment 2 Daniel Veillard 2013-06-14 17:03:26 EDT
That's unrelated to Relax-NG it is about the datatype library for XML Schemas
(XSD) that can be used from Relax-NG. They are referred by namespace from
RNG and their namespace is defined in the XSD specification:

The usage of the XSD datatype as we did is suggested in the RelaxNG specification
itself in the RELAX NG schemas for RELAX NG :-)


In a nutshell the "experimental support from xjc" seems broken. The error is in
the Java generating toolset. Sorry not a libvirt bug !

Comment 3 Daniel Veillard 2013-06-14 17:10:44 EDT
W.r.t. the missing start element, basictypes.rng is not the validating
schemas, that's an included one, and doesn't have the have a <start>


Last point, a tutorial is not a normative reference, the specification is
so playing tricks on bug reports to try to push the bug on our side with
an invalid reference won't get you very far :-) . Read the full RNG spec
first, you're lucky, it's a matter of one hour !

Comment 4 Susana Cabaço 2013-06-17 04:20:45 EDT
Ok thanks, will do, but what validator should be used then?
Because the thing that led me to open a bug ticket was that in fact the validator was complaining about a missing element.

Note You need to log in before you can comment on or make changes to this bug.