Previous | Table of Contents | Next |
In the following example, one model group has a long name. The name of the last element group is too long to enable the minimization delimiters to be aligned on the same line. To keep the delimiters aligned, the declaration is continued on the next line.
<!ELEMENT firstelm - - (alpha, bet+) > <!ELEMENT alpha - - (CDATA) > <!ELEMENT bet - - (CDATA) > <!ELEMENT (a|bc|cd|ef|gh|hi|lm|no|pq|rs) - - (#PCDATA) --this stays aligned-->
It is not always necessary to align all parts of declarations with such fastidiousness, particularly when youre simply trying to get it to parse. But as you refine the DTD, and as it becomes more of a tool for your daily work, youll find it easiest to keep it aligned thoroughly, much as a good mechanic keeps his or her toolbox tidy and organized.
You should try to keep the following items aligned in a declaration:
In other words, you should align everything in a declaration or comment that can be reasonably aligned. Its pleasing to the eye and it makes a DTD easier to use.
Consider the comments in listing 12.2. The comments for each group of elements are aligned on the same column. Furthermore, the comments within each group are aligned. Even the line comments are aligned more or less at the end of the declaration lines.
You have made it through the essential principles of content modeling and document analysis. You are nearly through developing the DTD.
For more information, refer to the following:
Previous | Table of Contents | Next |