RELAX NG by Eric van der Vlist will be published by O'Reilly & Associates (ISBN: 0596004214)

You are welcome to use our annotation system to give your feedback.


Problems that never arise

Some of the restrictions which add a lot of complexity in other schema languages are not issues for RELAX NG. We've seen at least two places in this chapter where we avoided restrictions. The first case appears as the ability to define attributes wherever you want in your patterns. This reduction in rules doesn't make a big difference when you define the content model of elements as straightforwardly as we did in our first schema, but it makes a huge difference when we start to combine patterns as we've done with our bizarre model. Without this removal of restrictions, it would have been impossible to define one attribute in the pattern book-extended and a second one in the pattern book-basic.

The other non-restriction is that RELAX NG pays no attention to the pattern used to match a node of the instance document when there are several possibilities. Again, in our bizarre pattern, if we have a document with a book having only one author, there is no way to tell if this author matches the optional "author" element of the pattern "book-start" or the zero or more "author" elements of the pattern "book-author". This would be considered an ambiguity intolerable to other schema languages. In this case, RELAX NG considers that even though there is an ambiguity, since there is at least one interpretation of the schema for which the document is valid, then the document should be considered as valid. We will learn more about these ambiguities and their consequences on their uses in Chapter 16: Determinism and Datatype Assignment.


You are welcome to use our annotation system to give your feedback.
[Annotations for this page]
All text is copyright Eric van der Vlist, Dyomedea. During development, I give permission for non-commercial copying for educational and review purposes. After publication, all text will be released under the Free Software Foundation GFDL.