by Eric van der Vlist is published by O'Reilly & Associates (ISBN: 0596004214)


Simplification and Restrictions

Table of Contents

15.1. Simplification
15.1.1. Annotation Removal, Whitespace and Attribute Normalization, and Inheritance
15.1.2. Retrieval of External Schemas
15.1.3. Name Class Normalization
15.1.4. Pattern Normalization
15.1.5. First Set of Constraints
15.1.6. Grammar Merge
15.1.7. Schema Flattening
15.1.8. Final Cleanup
15.2. Restrictions
15.2.1. Constraints on Attributes
15.2.2. Constraints on Lists
15.2.3. Constraints on Except Patterns
15.2.4. Constraints on Start Patterns
15.2.5. Constraints on Content Models
15.2.6. Limitations on interleave

Simplification and restriction are two topics that I have generally avoided throughout this book. They're deeply technical and don't have much direct impact when you're writing a RELAX NG schema. Still, this book wouldn't be complete without describing simplifications and restrictions.

Why should you care at all about simplification if it's so technical and looks like an implementation algorithm? To be honest, most of the time you don't have to care about this stuff at all. Simplification can be seen as an intermediate step when a RELAX NG processor reads a schema. During this step, all the syntactical sugar is removed, and the processor can then work with a perfectly normalized schema. The few restrictions that exist when using RELAX NG are formalized relative to this normalized version of the schema. Because of the flexibility of RELAX NG, formalizing restrictions on schemas before simplification would be very complex and difficult to read. The downside of not having to worry about such things most of the time is that when you do hit one of these restrictions, you often need to understand the main principles of the simplification process to understand what's happening. The good news is that it doesn't happen very often!


This text is released under the Free Software Foundation GFDL.