to the main page about the tutorial  THE XML REVOLUTION  -  TECHNOLOGIES FOR THE FUTURE WEB back up next

Problems with DTD

Top 15 reasons for avoiding DTD:
  1. not itself using XML syntax (the SGML heritage can be very unintuitive + if using XML, DTDs could potentially themselves be syntax checked with a "meta DTD")

  2. mixed into the XML 1.0 spec (would be much less confusing if specified separately + even non-validating processors must look at the DTD)

  3. no constraints on character data (if character data is allowed, any character data is allowed)

  4. too simple attribute value models (enumerations are clearly insufficient)

  5. cannot mix character data and regexp content models (and the content models are generally hard to use for complex requirements)

  6. no support for Namespaces (of course, XML 1.0 was defined before Namespaces)

  7. very limited support for modularity and reuse (the entity mechanism is too low-level)

  8. no support for schema evolution, extension, or inheritance of declarations (difficult to write, maintain, and read large DTDs, and to define families of related schemas)

  9. limited white-space control (xml:space is rarely used)

  10. no embedded, structured self-documentation (<!-- comments --> are not enough)

  11. content and attribute declarations cannot depend on attributes or element context (many XML languages use that, but their DTDs have to "allow too much")

  12. too simple ID attribute mechanism (no points-to requirements, uniqueness scope, etc.)

  13. only defaults for attributes, not for elements (but that would often be convenient)

  14. cannot specify "any element" or "any attribute" (useful for partial specifications and during schema development)

  15. defaults cannot be specified separate from the declarations (would be convenient to have defaults in separate modules)

back COPYRIGHT © 2000-2003 ANDERS MØLLER & MICHAEL I. SCHWARTZBACH next