| |
-
| | A statement of ownership/responsibility for the field. Thus I have developed two quite widely known DTDs: CML
and (with Lesley West) VHG. The fact that there is a DTD in an area is a statement that someone/some_org is taking responsibility for the XML developments. This has been extremely useful in both of these areas. It is often coupled to the use of namespaces. Thus CML
:* elements are likely to belong to a CML
namespace and the "fragment support" that that offers. |
-
| | A formal listing of the allowed elements, attributes (and possibly attribute values). In element-oriented computing (where XML elements are mapped onto, say, Java code) this can representpart
of a formal contract between the architecture designer and the programmer. Thus, in CML
, it is expected that a CML
application has some way of processing (rendering, transforming, validating, editing) <molecule>, etc. Note that it may not be necessary for the content model to be well defined as long as descriptions of the requirements are attached to the elements |
-
| | A specification of content models. This is increasingly difficult to design and maintain as technical subjects are highly likely to re-use elements from other namespaces. DTDs cannot easily support multiple namespaces either syntactically (e.g. what is the prefix?) or anticipate the range of content models. In simple cases (where the content is known to be #PCDATA) the model may be useful. Also, a DTD-driven editor may be able to offer the author a list of allowable elementNames in a given context. |
-
| | Attribute values. Attribute value enumeration is the only real way DTDs can constrain (string) values. In some cases this may be valuable, but it is very limited |
-
| | Minimisation. The main value of this is to add "hidden" or default attribute names/values. This is of debatable value in many cases as the reader may read the document as "what I see is what I get" and "where didthis
come from?" is a nasty surprise. |
-
| | Entity management. A DTD is syntactically necessary for entity management. I usually try to use the internal subset for this so that at least the logic is visible and the spirit is therefore "well-formed" |
-
| | Syntactic validation of document content and attributes. This can be useful for certain DTDs and we use it in this way for the VHG applications, where we encourage conformity. It is a (limited) way of encouraging good practice within a community. However much of our extensibility is through unconstrained attribute values. |
-
| | Authoring tools. Lists of potential elements and attributes can be very useful and avoid the need for manuals. The VHG is simple enough to author manually, but benefits from a DTD-driven authoring tool. [All content models are of form (A|B|C)* or (#PCDATA) so that order is unimportant]. |
|