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.


Patterns, and only patterns

In science, strong theories tend to be simple, yet have almost infinite potential for complexity in application. RELAX NG is, because of its simplicity, one of those theories that is easy to explain, easy to implement, and generic and flexible enough to meet the most stringent requirements.

We will present the RELAX NG patterns throughout this book, but I'd like to make a brief introduction here. In RELAX NG, there are three basic patterns that match the three types of XML nodes:

These basic patterns can be combined into ordered or non-ordered groups and used in choices defining alternatives among several patterns. The cardinality of a pattern, the number of times that it can appear in an instance document, can also be controlled. Text nodes can be also be constrained as data, which can be limited to particular datatypes and possibly be split into list items. Lastly, a whole set of features supports the creation of reusable libraries of patterns. Similar to patterns, name classes define sets of elements and attributes that can be used to open a schema and control where elements and attributes with unknown names may be included in the instance documents.

Some of these features have been defined to facilitate the work of writing RELAX NG schemas and go beyond the basic(sometimes called "atomic") patterns. To avoid complicating the basic model with these convenience features, the RELAX NG specification describes a simplification algorithm. This algorithm is used internally by RELAX NG processors to transform a full schema into a simpler form with fewer and simpler patterns. This algorithm is presented in Chapter 15: Simplification And Restrictions.

[Note]Note

RELAX NG does not pay attention to XML Processing Instructions and comments.


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.