Bug 974650 - libvirt schemas are not valid relaxng
Summary: libvirt schemas are not valid relaxng
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: All
OS: All
unspecified
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-14 17:35 UTC by Susana Cabaço
Modified: 2013-06-17 08:20 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-14 21:03:26 UTC
Embargoed:


Attachments (Terms of Use)

Description Susana Cabaço 2013-06-14 17:35:10 UTC
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:
1.
2.
3.

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 20:41:28 UTC
Hey DV, since you're the resident XML expert, can you weigh in here?

Comment 2 Daniel Veillard 2013-06-14 21:03:26 UTC
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:
  http://www.w3.org/TR/xmlschema-2/#namespaces

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

  https://www.oasis-open.org/committees/relax-ng/spec-20011203.html#IDA5MCS

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

Daniel

Comment 3 Daniel Veillard 2013-06-14 21:10:44 UTC
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>

https://www.oasis-open.org/committees/relax-ng/spec-20011203.html#IDAG3YR

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 !

Daniel

Comment 4 Susana Cabaço 2013-06-17 08:20:45 UTC
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.