How to convert XML Schema (XSD) to Relax NG?

The Sun RELAX NG converter is presented on the Relax NG homepage , which is apparently able to convert the XSD file to relaxng, but the dead link and blog post about secondary sources are also out of date.

I am not interested in web converter.

Btw, the XML schema I want to convert uses inheritance.

+6
source share
3 answers

Kohsuke Kawaguchi Relax NG converter (aka Sun Relax NG Converter) is currently available at http://java.net/projects/msv and http://search.maven.org/#search%7Cga%7C1%7Cg%3A % 22net.java.dev.msv% 22 (thanks to KK for the info).

+5
source

The old Sun RELAX NG converter is currently bundled with (Sun) "Multi-Schema Validator" - msv. With this term, you can search your distribution package repository.

For example, Fedora (e.g. 17) includes it.

Install on Fedora

# yum install msv-rngconv msv-manual 

Using Fedora

 $ rngconv my.xsd > my.rng 

Check the result:

 $ xmllint --relaxng my.rng --noout some.xml 

Convert to compact syntax:

 $ trang -I rng -O rnc my.rng my.rnc 

(trang is also available through the main Fedora package repository)

Another way (perhaps after adding the file to the syntax file):

 $ trang -I rnc -O rng my.rnc my.rng 

Msv seems pretty powerful - I tested it with a pretty xsd file size that uses inheritance, advanced templates and includes another xsd file.

+4
source

Have you tried Trang ? (I do not know how this relates to inheritance)

See also xsd for converting rnc (or rng) (unix command line) for a general discussion about converting XSD to RELAXNG. It seems that Sun RELAX NG Converter is located under the name rngconv and is still hiding in certain places: http://rpm.pbone.net/index.php3?stat=3&search=msv-rngconv&srodzaj=3

0
source

All Articles