RELAX NG (pronounced " relaxing ") is the real sleeper of schema languages, but it has the potential to become the most popular schema language of all. Where the W3C XML Schema Language can feel a bit intimidating at times, RELAX NG is far simpler and cleaner, perhaps because RELAX NG is primarily the product of two smart developers (James Clark and Murata Makoto) rather than a design by committee. RELAX NG can do everything DTDs can do except define entities and notations, and it can do everything the W3C Schema Language can do except define new data types. However, RELAX NG does enable you to reference different data type libraries, including the W3C's own set of XML Schema primitive types.

Key features of RELAX NG include the following:

  • Extensive support for parentchild structures

  • Exceptional support for order-independent structures and constraints

  • External data type libraries that support various kinds of simple data types

  • Namespace-aware validation

  • Annotation of elements

  • Great ease of writing and reading, both in XML and non-XML forms

RELAX NG is most appropriate when:

  • Most validation is concerned with element and attribute structure, not with the content of elements and attributes.

  • Simple data types are sufficient.

  • Ease of schema authoring is a primary concern.

  • Very complicated validation rules require a traditional programming language to implement; for example, a key element contains a prime number or a time element contains a value in the past.

RELAX NG is least appropriate when:

  • Element constraints are based on sibling, ancestor , or descendant relationships rather than parentchild relationships.

Because RELAX NG does not come with the W3C imprimatur, it has not gained as broad a mind share as the W3C XML Schema Language. However, as more developers experiment with schemas and discover that the W3C XML Schema Language is just too baroque for their tastes, many of them are choosing RELAX NG instead. Most recently the members of the OASIS OpenOffice XML Format Technical Committee have committed to writing their schemas in RELAX NG instead of the W3C XML Schema Language. If you need something with all the expressivity of the W3C XML Schema Language but none of its complexity and verbosity , you really can't do better than RELAX NG.

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 © 2008-2017.
If you may any questions please contact us: