Sams Teach Yourself XML in 21 Days

Sams Teach Yourself XML in 21 Days

By Steven Holzner

Q&A

  1. These days, DTDs and XML schemas are both popular. Which should I use?

    The answer depends on several factors. Which does your target XML processor support? Which are you more comfortable with? Can DTDs give you the precision you want, or do you need to turn to schemas? DTDs have been around longer than schemas. A casual Web search turns up 1.9 million matches to "DTD" but only 385,000 to "XML schema." And many beginning XML authors find DTDs easier to work with than schemas. Nonetheless, XML schemas are where the growth is these days. Microsoft has thrown its weight behind schemas, so the industry as a whole is shifting toward them.

  2. The DTD syntax is just too complex. Isn't there some way to make writing a DTD easier?

    Take a look at the automatic DTD generators available online. You just navigate to a DTD generator on the Web, click a button to browse to the XML document on your disk for which you want a DTD, and click a button to upload the document; the DTD generator does the rest. For example, take a look at the DTD generators at (as of this writing) http://www.pault.com/pault/dtdgenerator and http://www.hitsw.com/xml_utilites.

Share ThisShare This

Informit Network