Thursday 8 August 2013

Conversion of W3C schema to RelaxNG

There appears to be a scant lack of tools for such conversions. Two I have found are:

 RNG Convert


rngconvert which can be found at: http://java.net/downloads/msv/nightly/ 

This is a java based utility that can convert RELAX Core, RELAX namespace, TREX,
or W3C XML Schema or DTD  to RELAX NG. It is run with the following command line (which automatically detects the schema type):

java -jar rngconv.jar myschema.xsd > result.rng

Or for an XML DTD the -dtd option is needed:

java -jar rngconv.jar -dtd myschema.dtd > result.rng

XSD to RNG Converter


This project was initially hosted by google code (http://code.google.com/p/xsdtorngconverter/) but is now on github - https://github.com/epiasini/XSDtoRNG

This is a straight forward common or garden XSLT v1.0

I have not tried either of these tools as yet but will add to this posting as and when I do.