XML Schemas: the better way
Lots of people use XSD as their sole solution to XML needs because it is
so powerfuland it is from Microsoft.
Microsoft employees have posted blog entries deploring the unnecessary complexity of XSD. For some of its newest XML file formats, W3 has switched to using other schema languages such as RELAX NG to define the syntax of their files. These other schemas are shorter and more readable too.
What is refreshing about the non-XSD schema community is that they use more modular means of defining/validating their XML file formats than XSD. The schemas are very easy to read/write. They are way simpler for a computer program to process and understand than XSD or even DTD.
Here is a nice set of Schema Design Guidelines I stumbled across on the web this afternoon. The goal is to do the very things I just outlined above as a practice, when defining XML file formats.
XML Schemas: Best Practices
It is a great idea, huh?
Schematron is one of the simplest computer languages I have ever come across. It is an XML-based format for defining validation rules for checking the syntax of a given XML file format.
RELAX NG is easier for people to learn than XSD. Anyone who knows the basics of regular expressions and BNF will have little or no trouble learning it very quickly, especially its Compact form (.RNC file format).
You can probably learn this stuff quicker than you can hand-code your next XSD file from scratch.
Once you have the .RNG grammar file, it is more useful than the .XSD file. Throw in a .SCH (Schematron) rule file - and you are far ahead of that XSD file you are picking away at.


0 Comments:
Post a Comment
<< Home