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