Page 1 of 1
Combine Multiple RelaxNG Schemas
Posted: Wed Aug 12, 2009 6:49 pm
by kruncher
Hi guys,
I have a large selection of RelaxNG schemas files. There is one root most file which is called "selector.rng", and this includes the various other RelaxNG modules.
Is there a utility that will combine all of these schemas into a single file?
Many thanks!
Lea Hayes
Re: Combine Multiple RelaxNG Schemas
Posted: Thu Aug 13, 2009 9:56 am
by george
Hello,
The latest version of Jing can get you a serialization of the simplified parsed schema. To get the latest Jing you can either
checkout the project from
http://code.google.com/p/jing-trang/source/checkout
and run ant
or
you can get a compiled jar that I posted here
http://code.google.com/p/jing-trang/iss ... l?id=79#c6
Then you can invoke it with something like
java -jar jing.jar -s selector.rng
Best Regards,
George
Re: Combine Multiple RelaxNG Schemas
Posted: Thu Aug 13, 2009 9:22 pm
by kruncher
Thanks George, that is fantastic!
I have a couple of Schematron bits that get lost, but this isn't too much of a problem because I can just drop those back in manually.
Thanks again!
Lea Hayes
Re: Combine Multiple RelaxNG Schemas
Posted: Sun Oct 18, 2009 6:54 pm
by kruncher
Hi George,
I have another question regarding Jing and Trang.
I created the following Windows batch file using your advise, and this has been working great. In a Java project I have added the "jing.jar" and "trang.jar" into the build path. Do you know how I can replicate the following functionality in Java?
java -jar jing.jar -s rng\selector.rng > extensions.standalone.rng
java -jar trang.jar extensions.standalone.rng extensions.rnc
Essentially I would like to add two buttons to my program. One which combines RelaxNG schema into a single file, and another which does the same but also converts to RelaxNG Compact.
Many thanks,
Lea Hayes
Re: Combine Multiple RelaxNG Schemas
Posted: Mon Oct 19, 2009 8:26 am
by george
When you run from command line specifying a jar you actually invoke the main method of the class specified as main class in the jar manifest file. For Jing the main class us com.thaiopensource.relaxng.util.Driver while for Trang it is com.thaiopensource.relaxng.translate.Driver.
You can either invoke these methods or you can look how they are implemented and extract code from them create your class.
Best Regards,
George
Re: Combine Multiple RelaxNG Schemas
Posted: Mon Oct 19, 2009 4:01 pm
by kruncher
Thanks again for your help!