entity
There are five predefined XML entities that HTML coders should be familiar with. The characters &, <, >, " and ' in XML documents are represented as &, @lt;, >, " and ' respectively.
XML greatly extends the functionality of entities - allowing entities to be defined in a DTD for use in the rest of the document. For example, I need to frequently use the phrase "Wired Digital" in XML documents, which can be represented in the DTD like this:
<!ENTITY wd "Wired Digital">
So when I use this phrase, I can type &wd;. This avoids misspellings and retyping the same information. Entities can function as macros in word processors.
The text being replaced can be arbitrarily long, but if it is really long, you may want to store the information in another file. This can be achieved via an external entity reference - using the keyword SYSTEM in the entity name and the URL of the file:
<!ENTITY text SYSTEM "http://my.url.here">
These features are powerful, but have one drawback: they cannot be extended within a DTD. In order to implement extended functionality, a special tool called a parameter entity is required. It is implemented in the entity definition by inserting "%" before the entity name. Once defined, parameter definitions can be accomplished by surrounding the parameter name with percent colons and semicolons.
Why do this? Take a look at the code below:
<!ELEMENT vCard (%prop.man;, (%prop.id; | %prop.del; |
%prop.tel; | %prop.geo; | %prop.org; |
%prop.exp; | %prop.sec;)*)>
This code comes from a public XML business card draft. When defining the root element, the author finds it easier to separate information into different parameter entities. If we look at one of these entities, we'll know why. Take a look at the prop.id entity below:
<!ENTITY % prop.id "
(nickname | photo | bday)">
If each entity was represented by such a long string, the element definition would be difficult to read.
Now it's time to read some DTD.
Jay Greenspan ISO-8859-1 Entities
Named
Entity Numeric
Entity Glyph Description
�-
unused
horizontaltab
linefeed
unused
space
! !exclamationmark
" " " doublequotationmark
# # numbersign
$ $ dollarsign
% % percentsign
& & & amperstand
' ' apostrophe
(( leftparenthesis
) ) rightparenthesis
* * asterisk
+ +plussign
, , comma
- -hyphen
. . period(fullstop)
Named
Entity Numeric
Entity Glyph Description
// solidus(slash)
0-
9 digits0-9
: : colon
; ; semicolon
< < < less-thansign
= = equalssign
> > > greater-thansign
? ?questionmark
@ @ commercialat
A-
Z letters AZ
[ ][ leftsquarebracket
reversesolidus(backslash)
] ] rightsquarebracket
^ ^ caret
_ _ horizontalbar(underscore)
` ` acuteaccent
a-
z letters az
{ { leftcurlybrace
| | verticalbar
Named
Entity Numeric
Entity Glyph Description
} } rightcurlybrace
~ ~ tilde
-
Ÿ unused
non-breakingspace
¡ ¡ invertedexclamation
¢ ¢ centsign
£ £ poundsterling
¤ ¤ generalcurrencysign
¥ ¥ yensign
¦ ¦ brokenverticalbar
§ § sectionsign
¨ ¨umlaut(dieresis)
© © © copyright
ª ª feminine ordinal
« « leftanglequote, guillemotleft
¬ ¬ notsign
softhyphen
® ® registeredtrademark
¯ ¯ macronaccent
Named
Entity Numeric
Entity Glyph Description
° °degreesign
± ± plusorminus
² ² superscripttwo
³ ³superscriptthree
´ ´ acuteaccent
µ µ microsign
¶ ¶ paragraphsign
· · middledot
¸ ¸ cedilla
¹ ¹superscriptone
º º masculine ordinal
» » rightanglequote, guillemotright
¼ ¼ one-fourth
½ ½ one-half
¾ ¾ three-fourths
¿ ¿ invertedquestionmark
À À À uppercaseA, graveaccent
Á Á Á uppercaseA, acuteaccent
   uppercaseA, circumflexaccent
Named
Entity Numeric
Entity Glyph Description
à à à uppercaseA, tilde
Ä Ä Ä uppercaseA, dieresisorumlautmark
Å Å Å uppercaseA, ring
Æ Æ Æ uppercaseAEdipthong(ligature)
Ç Ç Ç uppercaseC, cedilla
È È È uppercaseE, graveaccent
É É É uppercaseE, acuteaccent
Ê Ê Ê uppercaseE, circumflexaccent
Ë Ë Ë uppercaseE, dieresisorumlautmark
Ì Ì Ì uppercaseI, graveaccent
Í Í Í uppercaseI, acuteaccent
Î Î Î uppercaseI, circumflexaccent
Ï Ï Ï uppercaseI, dieresisorumlautmark
Ð Ð Ð uppercaseEth, Icelandic
Ñ Ñ Ñ uppercaseN, tilde
Ò Ò Ò uppercaseO, graveaccent
Ó Ó Ó uppercaseO, acuteaccent
Ô Ô Ô uppercaseO, circumflexaccent
Õ Õ Õ uppercaseO, tilde
Named
Entity Numeric
Entity Glyph Description
Ö Ö Ö uppercaseO, dieresisorumlautmark
× × multiplysign
Ø Ø Ø uppercaseO, slash
Ù Ù Ù uppercaseU, graveaccent
Ú Ú Ú uppercaseU, acuteaccent
Û Û Û uppercaseU, circumflexaccent
Ü Ü Ü uppercaseU, dieresisorumlautmark
Ý Ý Ý uppercaseY, acuteaccent
ð ð Þ uppercaseTHORN, Icelandic
ß ß ß lowercasesharps, German(szligature)
à à à lowercasea, graveaccent
á á á lower casea, acute accent
â â â lowercasea, circumflexaccent
ã ã ã lowercasea, tilde
ä ä ä lowercasea, dieresisorumlautmark
å å å lowercasea, ring
æ æ æ lowercaseaedipthong(ligature)
ç ç ç lowercase, cedilla
è è è lowercase, graveaccent
Named
Entity Numeric
Entity Glyph Description
é é é lowercase, acuteaccent
ê ê ê lowercase, circumflexaccent
ë ë ë lowercasee, dieresisorumlautmark
ì ì ì lowercasei, graveaccent
í í í lowercasei, acuteaccent
î î î lowercasei, circumflexaccent
ï ï ï lowercasei, dieresisorumlautmark
ð ð ð lowercaseeth, Icelandic
ñ ñ ñ lowercasen, tilde
ò ò ò lowercaseo, graveaccent
ó ó ó lowercaseo, acuteaccent
ô ô ô lowercaseo, circumflexaccent
õ õ õ lowercaseo, tilde
ö ö ö lowercaseo, dieresisorumlautmark
÷ ÷ divisionsign
ø ø ø lowercaseo, slash
ù ù ù lowercase, graveaccent
ú ú ú lower case, acute accent
û û û lowercase, circumflexaccent
Named
Entity Numeric
Entity Glyph Description
ü ü ü lowercaseu, dieresisorumlautmark
ý ý ý lowercasey, acuteaccent
þ þ þ lowercasethorn, Icelandic
ÿ ÿ ÿ lowercasey, dieresisorumlautmark