Guidelines for Developing Schemas
- Don't do it! Reuse, don't reinvent. If there are schemas that already express the
XML vocabularies that you need, use them. That said, there are costs to using someone else's schemas;
namely, you don't have control over them. Thus, bias toward reuse but understand the costs.
- Use the right schema language for the job. Each grammar based schema language — DTD,
XML Schema, Relax NG — has advantages and disadvantages. Know when to use what language.
- Use a rule-based language. Far too often people think only about defining the set of tags
(i.e., defining a grammer) and forget about defining data relationships (using a rule-based language).
Schematron is a rule-based language. Use Schematron.
- Make operational data central. Progressively enhance operational data with metadata.
I have observed a trend to make metadata central, which is then enhanced with operational data. Sigh.
This is completely backwards.
- Create jellybeans, not jellybean jars [Jelliffe]. Rather than
creating large, nested, monolithic structures, create small, flat, independent structures that can be assembled together
in a variety of ways.
- Create schema language independent documentation. Don't force users of your XML vocabulary
to read the schema code. Create documentation that enables the use of
your XML vocabulary without having to understand the particular schema language you used to implement it.
- Rise above particular schema languages. Learn to think in terms of assembling simple XML vocabularies —
wherever they may come from, whatever language they may be written in &mdash to generate complex structures.
Learn to create and use metaschemas. Use NVDL.