Entity reference
From MobileRead
An entity in XML is a named body of data, usually text. Entities are often used to represent single characters that cannot easily be entered on the keyboard; they are also used to represent pieces of standard ("boilerplate") text that occur in many documents, especially if there is a need to allow such text to be changed in one place only.
Special characters can be represented either using entity references, or by means of numeric character references. An example of a numeric character reference is "€", which refers to the Euro symbol by means of its Unicode codepoint in hexadecimal.
An entity reference is a placeholder that represents that entity. It consists of the entity's name preceded by an ampersand ("&") and followed by a semicolon (";").
[edit] XML entities
XML has five predeclared entities:
-
&(& or "ampersand") -
<(< or "less than") -
>(> or "greater than") -
'(' or "apostrophe") -
"(" or "quotation mark")
[edit] HTML entities
There are 252 predefined entities for HTML including 4 from the list above (apos is missing). XHTML technically has 253 entries since the apos is included.
For a list of predefined Entities see XML and HTML character entity references or Character Entities
Articles in this wiki that show these special entities include Windows-1252, ISO-8859-1 and special characters, primarily the last two.
[edit] Entity creation
Entities can be defined once and then used over and over. They are defined by specifying the keyword followed by the expanded definition. Here is the syntax for creating an ENTITY:
<!ENTITY greeting1 "Hello world">

