O'Reilly logo

Effective XML: 50 Specific Ways to Improve Your XML by Elliotte Rusty Harold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Item 5. Comment DTDs Liberally

DTDs can be as obfuscated as C++ code written by a first-year undergrad. You should use lots of comments to explain exactly what's going on. Well-written DTDs such as the modular XHTML DTD often contain more than twice as many lines of comments as actual code. The list that follows shows some of the information you should include in a DTD.

  • Who wrote it and how to contact them

  • The copyright and use conditions that apply to the DTD

  • The version of the DTD

  • The namespace URI

  • The PUBLIC and SYSTEM identifiers for the DTD

  • The root elements

  • A brief description of the application the DTD models

  • The purpose and content of each parameter entity defined

  • The purpose and content of each general entity defined

  • The meaning of each element ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required