RelaxNG vs XML Schema

jmq picture jmq · Feb 14, 2011 · Viewed 9.2k times · Source

I have a project where I'm using RelaxNG (jing) to validate xml. I like the syntax for RelaxNG, but most of the tools that I have work with XML schema (actually, I don't think I have a tool that does, other than jing). Am I making a design and future support mistake by using RelaxNG when most of the support seems to be around XML schema? Should I just stick with RelaxNG and make everyone else learn it (kicking and screaming if necessary, j/k)? Should I switch to xml schema because of tool support?

Thanks.

Answer

darioo picture darioo · Feb 14, 2011

The answers is a bit cliche: it depends.

On what, you might ask? On tools that your users will probably be using. And if you depend on your users, you might lose them if lack of good tools will drive them away. Since XML schema is, from my experience, very widely used, you might want to reconsider your decision on going forward with Relax NG. It is nicer and more easily understood than XML schema, but that doesn't mean it will make your project successful.

If you want to risk a bit, go ahead using Relax NG. And during every step of your development, try converting Relax NG to XML schema using a tool like Trang. Just in case you decide one day that Relax NG isn't worth it and you know you have a reasonable backup.