2

Here is the thing: I do not wish (yet) to do some operation in a vm via libvirt.

What I want to do is take the libvirt relaxng schemas and get java classes from them. This way I can produce an xml configuration file representing a virtual machine. Later on this file is going to be used in an operation that registers a machine into a hypervisor in order to be able to (for example) power it on.

So, my initial idea was to convert the relaxng schemas into xsd. Tried relaxer and trang, this is not really working.

Are there any good alternatives?

2 Answers2

0

The JAXB XJC tool included in the JDK includes some experimental support for relaxng schemas. You can try:

xjc -relaxng yourSchema

Or

xjc -relaxng-compact yourSchema
bdoughan
  • 147,609
  • 23
  • 300
  • 400
  • I keep getting stuff like this: [ERROR] datatype library "http://www.w3.org/2001/XMLSchema-datatypes" not recognized line 7 of file:/home/susana/workspace/myProjs/libvirtschemas/rng/basictypes.rng And sometimes it complains about the first character of the rng file being a < symbol. Maybe libvirt schemas are too relaxed... :/ –  Jun 10 '13 at 08:35
  • It doesn't work. It says `unrecognized parameter -relaxng-compact` or `unrecognized parameter -relaxng` – Mikhail Yevchenko Feb 01 '22 at 12:22
0

I looked up the current version of the basictypes.rng schema in the libvirt git repository, and used the online 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.

Rintze Zelle
  • 1,654
  • 1
  • 14
  • 30