Chapter 12. Writing Extensible Schemas

“Extensible” has become one of these buzzwords that has a very wide acceptance and yet is so worn out that it has become almost meaningless. Some buzzwords, however, remain useful despite their wear, so we should examine what an extensible schema might be.

There are two different forms of extensibility for a schema. First, the schema itself can be extensible: it can make it easy to derive variations of its patterns using named pattern combinations or redefinitions. Second, the schema could also describe extensible documents in which elements and attributes can be added without having to redefine the schema. Just such a schema is often called an open schema or open vocabulary .

These two forms of extensibility are largely independent of each other. A schema that is extensible as far as using combinations and redefinitions is concerned can be utterly strict, forbidding the slightest variation in instance documents. Similarly, a schema that describes perfectly open documents can be difficult to extend without redefining most of its patterns.

I describe both types of extensibility in this chapter.

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.