Planning the Content Model

Before you begin writing even the abstract module definition for your new module, it's always a good idea to sit down with pen and paper and map out all the components that need to be addressed. When developing new elements it's not always readily apparent what information should be stored in attributes, sub-elements, or even as PCDATA. Having a visual model of your data can help sort the information into the proper structures.

To create the model, three major questions need to be answered:

  1. What data needs to be stored?

  2. How is the data used?

  3. What constraints, if any, need to be placed on the data?

To illustrate the process we'll create a new abstract module and its corresponding DTD implementation for presenting recipes ...

Get XHTML by Example 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.