Generating DTDs

In the previous section, I covered the usage of the DDbE command-line application, but I didn't work through how to generate DTDs from actual XML documents. It's worth testing out DDbE on a few documents and analyzing the results to see how good it is at inferring a DTD from an XML document. The first document I want to tackle is the address book document from Chapter 1, "An XML Refresher," and Chapter 2, "Modeling Data: Document Type Definitions (DTD) and Schemas." If you'll recall, this document was used to store an address book containing contact information.

The following is the command required to generate a DTD from the address book document using the DDbE command-line application:

 java DDbECommandLine AddressBook.xml ...

Get XML Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.