Book HomeXML in a Nutshell

26.2. HTML4 Entity Sets

HTML 4.0 predefines several hundred named entities for use in your documents, many of which are quite useful. For instance, the nonbreaking space is  . XML, however, defines only five named entities:

&
The ampersand (&)

<
The less-than sign (<)

&gt;
The greater-than sign (>)

&quot;
The straight double quote (")

&apos;
The apostrophe (')

Other needed characters can be inserted with character references in decimal or hexadecimal format. For instance, the nonbreaking space is Unicode character 160 (decimal). Therefore, you can insert it in your document as either &#160; or &#xA0;. If you really want to type it as &nbsp;, you can define this entity reference in your DTD. Doing so requires you to use a character reference:

<!ENTITY nbsp "&#160;">

The XHTML 1.0 specification includes three DTD fragments that define the familiar HTML character references:

Latin-1 characters (http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent)
The non-ASCII, graphic characters included in ISO-8859-1 from code points 160 through 255, shown in Figure 26-3

Special characters (http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent)
A few useful letters and punctuation marks not included in Latin-1

Symbols (http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent)
The Greek alphabet, plus various arrows, mathematical operators, and other symbols used in mathematics

Feel free to borrow these entity sets for your own use. They should be included in your document's DTD with these parameter entity references and PUBLIC identifiers:

<!ENTITY % HTMLlat1 PUBLIC
   "-//W3C//ENTITIES Latin 1 for XHTML//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
%HTMLlat1;
<!ENTITY % HTMLspecial PUBLIC
    "-//W3C//ENTITIES Special for XHTML//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent">
%HTMLspecial;
<!ENTITY % HTMLsymbol PUBLIC
    "-//W3C//ENTITIES Symbols for XHTML//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent">
%HTMLsymbol;

However, we do recommend saving local copies and changing the system identifier to match the new location, rather than downloading them from the http://www.w3.org every time you need to parse a file. You may import just one, two, or all three of them, depending on what you need. There are no interdependencies.

Alternatively, just use the character references given in Table 26-4 through Table 26-6.

Table 26-4. The HTML Latin-1 entity set

Character

Meaning

XHTMLentity reference

Hexadecimalcharacter reference

Decimalcharacter reference

Nonbreaking space

&nbsp;
&#xA0;
&#160;

¡

Inverted exclamation mark

&iexcl;
&#xA1;
&#161;

¢

Cent sign

&cent;
&#xA2;
&#162;

£

Pound sign

&pound;
&#xA3;
&#163;

¤

Currency sign

&curren;
&#xA4;
&#164;

¥

Yen sign, Yuan sign

&yen;
&#xA5;
&#165;

|

Broken vertical bar

&brvbar;
&#xA6;
&#166;

§

Section sign

&sect;
&#xA7;
&#167;

Figure

Dieresis, spacing dieresis

&uml;
&#xA8;
&#168;

©

Copyright sign

&copy;
&#xA9;
&#169;

ª

Feminine ordinal indicator

&ordf;
&#xAA;
&#170;

«

Left-pointing double angle quotation mark, left-pointing guillemot

&laquo;
&#xAB;
&#171;

¬

Not sign

&not;
&#xAC;
&#172;

-

Soft hyphen, discretionary hyphen

&shy;
&#xAD;
&#173;

®

Registered trademark sign

&reg;
&#xAE;
&#174;

¯

Macron, overline, APL overbar

&macr;
&#xAF;
&#175;

°

Degree sign

&deg;
&#xB0;
&#176;

±

Plus-or-minus sign

&plusmn;
&#xB1;
&#177;

2

Superscript digit two, squared

&sup2;
&#xB2;
&#178;

3

Superscript digit three, cubed

&sup3;
&#xB3;
&#179;

´

Acute accent, spacing acute

&acute;
&#xB4;
&#180;

µ

Micro sign

&micro;
&#xB5;
&#181;

Pilcrow sign, paragraph sign

&para;
&#xB6;
&#182;

Figure

Middle dot, Georgian comma, Greek middle dot

&middot;
&#xB7;
&#183;

¸

Cedilla, spacing cedilla

&cedil;
&#xB8;
&#184;

1

Superscript digit one

&sup1;
&#xB9;
&#185;

º

Masculine ordinal indicator

&ordm;
&#xBA;
&#186;

»

Right-pointing double angle quotation mark, right-pointing guillemot

&raquo;
&#xBB;
&#187;

1/4

Vulgar fraction one-quarter

&frac14;
&#xBC;
&#188;

1/2

Vulgar fraction one-half

&frac12;
&#xBD;
&#189;

3/4

Vulgar fraction three-quarters

&frac34;
&#xBE;
&#190;

¿

Inverted question mark

&iquest;
&#xBF;
&#191;

À

Latin capital letter A with grave

&Agrave;
&#xC0;
&#192;

Á

Latin capital letter A with acute

&Aacute;
&#xC1;
&#193;

Â

Latin capital letter A with circumflex

&Acirc;
&#xC2;
&#194;

Ã

Latin capital letter A with tilde

&Atilde;
&#xC3;
&#195;

Ä

Latin capital letter A with dieresis

&Auml;
&#xC4;
&#196;

Å

Latin capital letter A with ring above, Latin capital letter A ring

&Aring;
&#xC5;
&#197;

Æ

Latin capital letter AE, Latin capital ligature AE

&AElig;
&#xC6;
&#198;

Ç

Latin capital letter C with cedilla

&Ccedil;
&#xC7;
&#199;

È

Latin capital letter E with grave

&Egrave;
&#xC8;
&#200;

É

Latin capital letter E with acute

&Eacute;
&#xC9;
&#201;

Ê

Latin capital letter E with circumflex

&Ecirc;
&#xCA;
&#202;

Ë

Latin capital letter E with dieresis

&Euml;
&#xCB;
&#203;

Ì

Latin capital letter I with grave

&Igrave;
&#xCC;
&#204;

Í

Latin capital letter I with acute

&Iacute;
&#xCD;
&#205;

Î

Latin capital letter I with circumflex

&Icirc;
&#xCE;
&#206;

Ï

Latin capital letter I with dieresis

&Iuml;
&#xCF;
&#207;

Figure

Latin capital letter eth

&ETH;
&#xD0;
&#208;

Ñ

Latin capital letter N with tilde

&Ntilde;
&#xD1;
&#209;

Ò

Latin capital letter O with grave

&Ograve;
&#xD2;
&#210;

Ó

Latin capital letter O with acute

&Oacute;
&#xD3;
&#211;

Ô

Latin capital letter O with circumflex

&Ocirc;
&#xD4;
&#212;

Õ

Latin capital letter O with tilde

&Otilde;
&#xD5;
&#213;

Ö

Latin capital letter O with dieresis

&Ouml;
&#xD6;
&#214;

x

Multiplication sign

&times;
&#xD7;
&#215;

Ø

Latin capital letter O with stroke

&Oslash;
&#xD8;
&#216;

Ù

Latin capital letter U with grave

&Ugrave;
&#xD9;
&#217;

Ú

Latin capital letter U with acute

&Uacute;
&#xDA;
&#218;

Û

Latin capital letter U with circumflex

&Ucirc;
&#xDB;
&#219;

Ü

Latin capital letter U with dieresis

&Uuml;
&#xDC;
&#220;

Figure

Latin capital letter Y with acute

&Yacute;
&#xDD;
&#221;

Figure

Latin capital letter thorn

&THORN;
&#xDE;
&#222;

ß

Latin small letter sharp s, ess-zett

&szlig;
&#xDF;
&#223;

à

Latin small letter a with grave

&agrave;
&#xE0;
&#224;

á

Latin small letter a with acute

&aacute;
&#xE1;
&#225;

â

Latin small letter a with circumflex

&acirc;
&#xE2;
&#226;

ã

Latin small letter a with tilde

&atilde;
&#xE3;
&#227;

ä

Latin small letter a with dieresis

&auml;
&#xE4;
&#228;

å

Latin small letter a with ring above

&aring;
&#xE5;
&#229;

æ

Latin small letter ae, Latin small ligature ae

&aelig;
&#xE6;
&#230;

ç

Latin small letter c with cedilla

&ccedil;
&#xE7;
&#231;

è

Latin small letter e with grave

&egrave;
&#xE8;
&#232;

é

Latin small letter e with acute

&eacute;
&#xE9;
&#233;

ê

Latin small letter e with circumflex

&ecirc;
&#xEA;
&#234;

ë

Latin small letter e with dieresis

&euml;
&#xEB;
&#235;

ì

Latin small letter i with grave

&igrave;
&#xEC;
&#236;

í

Latin small letter i with acute

&iacute;
&#xED;
&#237;

î

Latin small letter i with circumflex

&icirc;
&#xEE;
&#238;

ï

Latin small letter i with dieresis

&iuml;
&#xEF;
&#239;

Figure

Latin small letter eth

&eth;
&#xF0;
&#240;

ñ

Latin small letter n with tilde

&ntilde;
&#xF1;
&#241;

ò

Latin small letter o with grave

&ograve;
&#xF2;
&#242;

ó

Latin small letter o with acute

&oacute;
&#xF3;
&#243;

ô

Latin small letter o with circumflex

&ocirc;
&#xF4;
&#244;

õ

Latin small letter o with tilde

&otilde;
&#xF5;
&#245;

ö

Latin small letter o with dieresis

&ouml;
&#xF6;
&#246;

÷

Division sign

&divide;
&#xF7;
&#247;

ø

Latin small letter o with stroke

&oslash;
&#xF8;
&#248;

ù

Latin small letter u with grave

&ugrave;
&#xF9;
&#249;

ú

Latin small letter u with acute

&uacute;
&#xFA;
&#250;

û

Latin small letter u with circumflex

&ucirc;
&#xFB;
&#251;

ü

Latin small letter u with dieresis

&uuml;
&#xFC;
&#252;

Figure

Latin small letter y with acute

&yacute;
&#xFD;
&#253;

Figure

Latin small letter thorn

&thorn;
&#xFE;
&#254;

ÿ

Latin small letter y with dieresis

&yuml;
&#xFF;
&#255;

Table 26-5. The HTML special characters entity set

Character

Meaning

XHTML entity reference

Hexadecimal character reference

Decimal character reference

"

Quotation mark, APL quote

&quot;
&#x22;
&#34;

&

Ampersand

&amp;
&#x26;
&#38;

'

Apostrophe mark

&apos;
&#x27;
&#39;

<

Less-than sign

&lt;
&#x3C;
&#60;

>

Greater-than sign

&gt;
&#x3E;
&#62;

Figure

Latin capital ligature OE

&OElig;
&#x152;
&#338;

Figure

Latin small ligature oe

&oelig;
&#x153;
&#339;

Figure

Latin capital letter S with caron

&Scaron;
&#x160;
&#352;

Figure

Latin small letter s with caron

&scaron;
&#x161;
&#353;

Figure

Latin capital letter Y with dieresis

&Yuml;
&#x178;
&#376;

~

Modifier letter circumflex accent

&circ;
&#x2C6;
&#710;

~

Small tilde

&tilde;
&#x2DC;
&#732;
 

En space

&ensp;
&#x2002;
&#8194;
 

Em space

&emsp;
&#x2003;
&#8195;
 

Thin space

&thinsp;
&#x2009;
&#8201;

Nonprinting character

Zero width nonjoiner

&zwnj;
&#x200C;
&#8204;

Nonprinting character

Zero width joiner

&zwj;
&#x200D;
&#8205;

Nonprinting character

Left-to-right mark

&lrm;
&#x200E;
&#8206;

Nonprinting character

Right-to-left mark

&rlm;
&#x200F;
&#8207;

-

En dash

&ndash;
&#x2013;
&#8211;

--

Em dash

&mdash;
&#x2014;
&#8212;

`

Left single quotation mark

&lsquo;
&#x2018;
&#8216;

'

Right single quotation mark

&rsquo;
&#x2019;
&#8217;

,

Single low-9 quotation mark

&sbquo;
&#x201A;
&#8218;

"

Left double quotation mark

&ldquo;
&#x201C;
&#8220;

"

Right double quotation mark

&rdquo;
&#x201D;
&#8221;

Figure

Double low-9 quotation mark

&bdquo;
&#x201E;
&#8222;

Figure

Dagger

&dagger;
&#x2020;
&#8224;

Figure

Double dagger

&Dagger;
&#x2021;
&#8225;

Figure

Per mille sign

&permil;
&#x2030;
&#8240;

Figure

Single left-pointing angle quotation mark

&lsaquo;
&#x2039;
&#8249;

Figure

Single right-pointing angle quotation mark

&rsaquo;
&#x203A;
&#8250;

Figure

Euro sign

&euro;  
&#x20AC;
&#8364;

Table 26-6. The HTML symbol entity set

Character

Meaning

XHTML entity reference

Hexadecimal character reference

Decimal character reference

Figure

Latin small f with hook, function, florin

&fnof;
&#x192;
&#402;

A

Greek capital letter alpha

&Alpha;
&#x391;
&#913;

B

Greek capital letter beta

&Beta;
&#x392;
&#914;

Figure

Greek capital letter gamma

&Gamma;
&#x393;
&#915;

Figure

Greek capital letter delta

&Delta;
&#x394;
&#916;

E

Greek capital letter epsilon

&Epsilon;
&#x395;
&#917;

Z

Greek capital letter zeta

&Zeta;
&#x396;
&#918;

H

Greek capital letter eta

&Eta;
&#x397;
&#919;

Figure

Greek capital letter theta

&Theta;
&#x398;
&#920;

I

Greek capital letter iota

&Iota;
&#x399;
&#921;

K

Greek capital letter kappa

&Kappa;
&#x39A;
&#922;

Figure

Greek capital letter lambda

&Lambda;
&#x39B;
&#923;

M

Greek capital letter mu

&Mu;
&#x39C;
&#924;

N

Greek capital letter nu

&Nu;
&#x39D;
&#925;

Figure

Greek capital letter xi

&Xi;
&#x39E;
&#926;

O

Greek capital letter omicron

&Omicron;
&#x39F;
&#927;

Figure

Greek capital letter pi

&Pi;
&#x3A0;
&#928;

Figure

Greek capital letter rho

&Rho;
&#x3A1;
&#929;

Figure

Greek capital letter sigma

&Sigma;
&#x3A3;
&#931;

T

Greek capital letter tau

&Tau;
&#x3A4;
&#932;

Figure

Greek capital letter upsilon

&Upsilon;
&#x3A5;
&#933;

Figure

Greek capital letter phi

&Phi;
&#x3A6;
&#934;

Figure

Greek capital letter chi

&Chi;
&#x3A7;
&#935;

Figure

Greek capital letter psi

&Psi;
&#x3A8;
&#936;

Figure

Greek capital letter omega

&Omega;
&#x3A9;
&#937;

Figure

Greek small letter alpha

&alpha;
&#x3B1;
&#945;

Figure

Greek small letter beta

&beta;
&#x3B2;
&#946;

Figure

Greek small letter gamma

&gamma;
&#x3B3;
&#947;

Figure

Greek small letter delta

&delta;
&#x3B4;
&#948;

Figure

Greek small letter epsilon

&epsilon;
&#x3B5;
&#949;

Figure

Greek small letter zeta

&zeta;
&#x3B6;
&#950;

Figure

Greek small letter eta

&eta;
&#x3B7;
&#951;

Figure

Greek small letter theta

&theta;
&#x3B8;
&#952;

Figure

Greek small letter iota

&iota;
&#x3B9;
&#953;

Figure

Greek small letter kappa

&kappa;
&#x3BA;
&#954;

Figure

Greek small letter lambda

&lambda;
&#x3BB;
&#955;

μ

Greek small letter mu

&mu;
&#x3BC;
&#956;

Figure

Greek small letter nu

&nu;
&#x3BD;
&#957;

Figure

Greek small letter xi

&xi;
&#x3BE;
&#958;

Figure

Greek small letter omicron

&omicron;
&#x3BF;
&#959;

Figure

Greek small letter pi

&pi;
&#x3C0;
&#960;

Figure

Greek small letter rho

&rho;
&#x3C1;
&#961;

Figure

Greek small letter final sigma

&sigmaf;
&#x3C2;
&#962;

Figure

Greek small letter sigma

&sigma;
&#x3C3;
&#963;

Figure

Greek small letter tau

&tau;
&#x3C4;
&#964;

Figure

Greek small letter upsilon

&upsilon;
&#x3C5;
&#965;

Figure

Greek small letter phi

&phi;
&#x3C6;
&#966;

Figure

Greek small letter chi

&chi;
&#x3C7;
&#967;

Figure

Greek small letter psi

&psi;
&#x3C8;
&#968;

Figure

Greek small letter omega

&omega;
&#x3C9;
&#969;

Figure

Greek small letter theta symbol

&thetasym;
&#x3D1;
&#977;

Figure

Greek upsilon with hook symbol

&upsih;
&#x3D2;
&#978;

Figure

Greek pi symbol

&piv;
&#x3D6;
&#982;

·

Bullet, black small circle

&bull;
&#x2022;
&#8226;

...

Horizontal ellipsis, three-dot leader

&hellip;
&#x2026;
&#8230;

´

Prime, minutes, feet

&prime;
&#x2032;
&#8242;

Figure

Double prime, seconds, inches

&Prime;
&#x2033;
&#8243;

¯

Overline, spacing overscore

&oline;
&#x203E;
&#8254;

/

Fraction slash

&frasl;
&#x2044;
&#8260;

Figure

Black letter capital I, imaginary part

&image;
&#x2111;
&#8465;

Figure

Script capital P, power set, Weierstrass p

&weierp;
&#x2118;
&#8472;

Figure

Black letter capital R, real part symbol

&real;
&#x211C;
&#8476;

Trademark sign

&trade;
&#x2122;
&#8482;

Figure

Aleph symbol, first transfinite cardinal

&alefsym;
&#x2135;
&#8501;

Figure

Leftward arrow

&larr;
&#x2190;
&#8592;

Figure

Upward arrow

&uarr;
&#x2191;
&#8593;

Figure

Rightward arrow

&rarr;
&#x2192;
&#8594;

Figure

Downward arrow

&darr;
&#x2193;
&#8595;

Figure

Left-right arrow

&harr;
&#x2194;
&#8596;

Figure

Downward arrow with corner leftward, carriage return

&crarr;
&#x21B5;
&#8629;

Figure

Leftward double arrow

&lArr;
&#x21D0;
&#8656;

Figure

Upward double arrow

&uArr;
&#x21D1;
&#8657;

Figure

Rightward double arrow

&rArr;
&#x21D2;
&#8658;

Figure

Downward double arrow

&dArr;
&#x21D3;
&#8659;

Figure

Left-right double arrow

&hArr;
&#x21D4;
&#8660;

Figure

For all

&forall;
&#x2200;
&#8704;

Figure

Partial differential

&part;
&#x2202;
&#8706;

Figure

There exists

&exist;
&#x2203;
&#8707;

Figure

Empty set, null set, diameter

&empty;
&#x2205;
&#8709;

Figure

Nabla, backward difference

&nabla;
&#x2207;
&#8711;

Figure

Element of

&isin;
&#x2208;
&#8712;

Figure

Not an element of

&notin;
&#x2209;
&#8713;

Figure

Contains as member

&ni;
&#x220B;
&#8715;

Figure

N-ary product, product sign

&prod;
&#x220F;
&#8719;

Figure

N-ary summation

&sum;
&#x2211;
&#8721;

-

Minus sign

&minus;
&#x2212;
&#8722;

*

Asterisk operator

&lowast;
&#x2217;
&#8727;

Figure

Square root, radical sign

&radic;
&#x221A;
&#8730;

Figure

Proportional to

&prop;
&#x221D;
&#8733;

Figure

Infinity

&infin;
&#x221E;
&#8734;

Figure

Angle

&ang;
&#x2220;
&#8736;

Figure

Logical and, wedge

&and;
&#x2227;
&#8743;

Figure

Logical or, vee

&or;
&#x2228;
&#8744;

Figure

Intersection, cap

&cap;
&#x2229;
&#8745;

Figure

Union, cup

&cup;
&#x222A;
&#8746;

Figure

Integral

&int;
&#x222B;
&#8747;

Figure

Therefore

&there4;
&#x2234;
&#8756;

~

Tilde operator, varies with, similar to

&sim;
&#x223C;
&#8764;

Figure

Approximately equal to

&cong;
&#x2245;
&#8773;

Figure

Almost equal to, asymptotic to

&asymp;
&#x2248;
&#8776;

Figure

Not equal to

&ne;
&#x2260;
&#8800;

Figure

Identical to

&equiv;
&#x2261;
&#8801;

Figure

Less than or equal to

&le;
&#x2264;
&#8804;

Figure

Greater than or equal to

&ge;
&#x2265;
&#8805;

Figure

Subset of

&sub;
&#x2282;
&#8834;

Figure

Superset of

&sup;
&#x2283;
&#8835;

Figure

Not a subset of

&nsub;
&#x2284;
&#8836;

Figure

Subset of or equal to

&sube;
&#x2286;
&#8838;

Figure

Superset of or equal to

&supe;
&#x2287;
&#8839;

Figure

Circled plus, direct sum

&oplus;
&#x2295;
&#8853;

Figure

Circled times, vector product

&otimes;
&#x2297;
&#8855;

Figure

Up tack, orthogonal to, perpendicular

&perp;
&#x22A5;
&#8869;

Figure

Dot operator

&sdot;
&#x22C5;
&#8901;

Figure

Left ceiling, APL upstile

&lceil;
&#x2308;
&#8968;

Figure

Right ceiling

&rceil;
&#x2309;
&#8969;

Figure

Left floor, APL downstile

&lfloor;
&#x230A;
&#8970;

Figure

Right floor

&rfloor;
&#x230B;
&#8971;

Figure

Left-pointing angle bracket, bra

&lang;
&#x2329;
&#9001;

Figure

Right-pointing angle bracket, ket

&rang;
&#x232A;
&#9002;

Figure

Lozenge

&loz;
&#x25CA;
&#9674;

Figure

Black spade suit

&spades;
&#x2660;
&#9824;

Figure

Black club suit, shamrock

&clubs;
&#x2663;
&#9827;

Figure

Black heart suit, valentine

&hearts;
&#x2665;
&#9829;

Figure

Black diamond suit

&diams;
&#x2666;
&#9830;



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.