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