Examples from Chapter 8 of The XML Bible, Document Type Definitions and Validity
Listing 8-1:
Hello XML with DTD
Listing 8-2:
Hello XML with DTD and style sheet
Listing 8-3:
Invalid Hello XML does not meet DTD rules
Listing 8-4:
A well-formed XML document for which a DTD will be written
Listing 8-5:
A valid document
Listing 8-6:
A valid document that contains a YEAR and normal text
Listing 8-7:
A valid document that contains a style sheet, a YEAR, and normal text
Listing 8-8:
A valid document that contains a style sheet, a YEAR element, and two LEAGUE children
Listing 8-9:
A valid XML document on baseball statistics with a DTD
Listing 8-10:
Another XML document that's valid according to the baseball DTD
Listing 8-11:
A valid document that uses empty tags
Listing 8-12:
A valid XML document that uses abbreviated tags defined in DTD comments
Listing 8-13:
A DTD for baseball
Listing 8-14:
Baseball statistics with an external DTD
Listing 8-15:
A baseball document whose DTD has both an internal and an external subset
Copyright 1999
Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified at April 19, 1999