External Unparsed Entities and Notations
Not all data is XML. There are a lot of ASCII text files in the world that
don’t give two cents about escaping < as < or adhering to the other
constraints by which an XML document is limited. There are probably
even more JPEG photographs, GIF line art, QuickTime movies, MIDI sound
files, and so on. None of these are well-formed XML, yet all of them
are necessary components of many documents.
The mechanism that XML suggests for embedding these things in
documents is the external unparsed entity. The
DTD specifies a name and a URL for the entity containing the non-XML
data. For example, this ENTITY
declaration associates the name turing_getting_off_bus with the JPEG image
at http://www.turing.org.uk/turing/pi1/busgroup.jpg:
<!ENTITY turing_getting_off_bus
SYSTEM "http://www.turing.org.uk/turing/pi1/busgroup.jpg"
NDATA jpeg>Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access