Item 24. Choose the Right Schema Language for the Job

About two years ago, the W3C XML Schema Working Group released the fruits of its labors into an eager world. The specification was titled simply "XML Schema." This has unfortunately given many people the mistaken idea that the language the group invented is the only schema language and that all others are doomed to fall by the wayside. In fact, nothing could be further from the truth. There are numerous XML schema languages available today, all with their own strengths and weaknesses. It behooves you to familiarize yourself with the different possibilities and to select the one that best fits your problem. Indeed, there's no reason you have to select only one. It's often useful to mix and match several schema languages and perform multiple layers of validation.

Four main schema languages are being actively developed and supported at the current time. Doubtless there will be more in the future but, in my opinion, today these four will most effectively achieve almost any end:

  1. The W3C XML Schema Language

  2. Document Type Definitions (DTDs)

  3. RELAX NG

  4. Schematron

Finally, some constraints are always going to require a traditional programming language such as Python, Java, or C++ to verify. I'll also explore the use of procedural code to verify constraints.



Effective XML. 50 Specific Ways to Improve Your XML
Effective XML: 50 Specific Ways to Improve Your XML
ISBN: 0321150406
EAN: 2147483647
Year: 2002
Pages: 144

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net