Why Use Other Schema Languages?

There are tools to convert to and from other schema languages; however RELAX NG is easier to write, it’s easier to generate, and it’s easier for applications to use. As far as validation is concerned, I see no good reason to use another tool. Even if your tools support only XML 1.0 DTDs or W3C XML Schema, you can automatically generate those formats from RELAX NG.

RELAX NG is still a little bit behind, however, in datatype assignment and data binding. Datatype assignment appears to be increasingly important for a whole set of applications, including many new features of the XPath 2.0, XSLT 2.0, and XQuery 1.0 family of future W3C recommendations. Because datatype assignment was out of the scope for RELAX NG during its development, RELAX NG is very permissive about nondeterministic schemas. This permissiveness can lead to unpredictable type assignment during processing. This is something worth keeping in mind when writing RELAX NG schemas that will later be transformed into W3C XML Schema schemas. I will explain this subject in detail in Chapter 16.

Get RELAX NG now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.