Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate object model out of RelaxNG schema with RNGOM - how to start?

I want to generate an object model out of an RelaxNG Schema.

Therefore I want to use the RNGOM Object Model/Parser (mainly because I could not find any alternative - although I don't even care about the language the parser is written in/generates). Now that I checked out the RNGOM source from SVN, I don't have ANY idea how to use RNGOM, since there is not any piece of information out there about the usage.

A useful hint how to start with RNGOM - a link, example, or any description which saves me from having to read understand the whole source code of RNGOM - will be awarded as an answer. Even better would be a simple example how to use the parser to generate an Object model out of an RNG file.

More infos:

I want to generate Java classes out of the following RelaxNG Schema:
http://libvirt.org/git/?p=libvirt.git;a=tree;f=docs/schemas;hb=HEAD

I found out that the Glassfish guys are using rngom to generate the same object model I need, but I could not yet find out how they are using rngom.

like image 586
Wolkenarchitekt Avatar asked Sep 30 '11 08:09

Wolkenarchitekt


1 Answers

A way to proceed could be to :

  1. use jing to convert from Relax NG to XML Schema (see here)
  2. use more common tools to generate classes (e.g. JaxB).
like image 180
Vincent Biragnet Avatar answered Oct 19 '22 23:10

Vincent Biragnet