Examples from Chapter 9 of The XML Bible, Entities and External DTD Subsets
Listing 9-1: The ERH internal general entity reference
Listing 9-2: Declarations for predefined general entity references
Listing 9-3: An XML signature file
Listing 9-4: The SIG external general entity reference
Listing 9-5: A DTD for the PLAYER element and its children (player.dtd)
Listing 9-6: A valid document using the PLAYER DTD
Listing 9-7: The TEAM DTD (team.dtd)
Listing 9-8: The SEASON DTD (season.dtd)
Listing 9-9: ChrisHoiles.xml
Listing 9-10: The New York Mets DTD with entity references for players (mets.dtd)
Listing 9-11: The New York Mets with players loaded from external entities (mets.xml)
Listing 9-12: The players DTD
Listing 9-13: Master document for the 1998 season using external entity references for players
Listing 9-14: The 1998 season using external entity references for teams
Listing 9-15: The ERH entity reference in a DTD yields a well-formed yet invalid document
Listing 9-16: A well-formed, but invalid, document
Listing 9-17: An extremely invalid, though still well-formed, document
Listing 9-18: A DTD for the non non-ASCII ISO-Latin-1 characters
Listing 9-19: A well-formed, invalid document that uses entity references for non ASCII ISO-Latin-1 characters
Listing 9-20: Signature boilerplate without a DTD
Listing 9-21: Signature DTD that defines an entity reference
Listing 9-22: A file that uses &SIGNATURE;
Listing 9-23: A file that uses &SIGNATURE; with one less level of indirection
Copyright 1999
Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified at April 2, 1999