Examples from Chapter 9 of The XML Bible, Gold Edition: Element Declarations
Listing 9-1:
A well-formed XML document for which a DTD will be written
Listing 9-2:
A DTD that declares SEASON and YEAR elements
Listing 9-3:
A DTD that declares SEASON and YEAR elements in a different order
Listing 9-4:
A valid document
Listing 9-5:
A valid document that contains a YEAR and normal text
Listing 9-6:
An invalid document that contains a SPORT element
Listing 9-7:
A valid document that contains a style sheet, a YEAR, and normal text
Listing 9-8:
A DTD that declares LEAGUE and LEAGUE_NAME elements
Listing 9-9:
A SEASON with two LEAGUE children
Listing 9-10:
A DTD for baseball
Listing 9-11:
A DTD for baseball
Listing 9-12:
A valid document using empty elements
Listing 9-13:
A DTD for abbreviated baseball statistics elaborated with comments
Listing 9-14:
Baseball statistics with short element names
Copyright 1999, 2001
Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified at January 9, 2001