A brief search shows that all available (uUnix command line) tools that convert from xsd (XML Schema) to rng (RelaxNG) or rnc (compact RelaxNG) have problems of some sort.
First, if I use rngconv:
$ wget https://msv.dev.java.net/files/documents/61/31333/rngconv.20060319.zip
$ unzip rngconv.20060319.zip
$ cd rngconv-20060319/
$ java -jar rngconv.jar my.xsd > my.rng
It does not have a way to de-normalize elements so all end up being alternative start elements (it also seems to be a bit buggy).
Trang is an alternative, but it doesn't support xsd files on the input only on the output (why?). It supports DTD, however. Converting to DTD first comes to mind, but a solid xsd2dtd is hard to find as well. The one below:
$ xsltproc http://crism.maden.org/consulting/pub/xsl/xsd2dtd.xsl in.xsd > out.dtd
Seems to be buggy.
All this is very surprising. For all these years of XML (ab)use, there no decent command line tools for these trivial basic tasks? Are people using only editors? Do those work? I much prefer command line, especially because I'd like to automate these tasks.
Any enlightening comments on this?