|
home—lects—exams—hws
breeze (snow day)
Originally based on XML Visual Quickstart Guide by Kevin Howard Goldberg, and notes therefrom by Jack Davis (jcdavis@radford.edu).
Entities are named-constants for your XML. With an entity, you define its name and the text it should expand into when referenced in an XML document. The entity reference is included in an XML document or DTD; it's replaced by defined-value upon rendering.
We will discuss “general entities” here. There are other types of entities (“parameter entities”, and parsed/unparsed versions of general entities), but they all work in the same way, and they are all defined through a DTD. The differences lie in where the entity can be expanded, and what kind of data it contains. See the textbook for further info on these other types of entities.
<story> The oldest of the &wow;, the Great Pyramid, is … </story>will render as “The oldest of the Wonders of the World, the Great Pyramid, is…”.
(remaining topics are optional — not frequently used:)
<!NOTATION jpg SYSTEM "image/jpeg">
<!ENTITY lighthouse_pic SYSTEM "lighthouse.jpg" NDATA jpg>
<!ELEMENT photo EMPTY>
<!ATTLIST photo source ENTITY #REQUIRED>
home—lects—exams—hws
breeze (snow day)
©2011, Ian Barland, Radford University Last modified 2011.Dec.13 (Tue) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |