In SGML, HTML and XML documents, the logical constructs known as character data and attribute values consist of sequences of characters, in which each character can manifest directly (representing itself), or can be represented by a series of characters called a character reference, of which there are two types: a numeric character reference and a character entity reference. This article lists the character entity references that are valid in HTML and XML documents.
Character reference overview In HTML and XML, a numeric character reference refers to a character by its Universal Coded Character Set/Unicode code point, and uses the format: &#xhhhh; or &#nnn; where the x must be lowercase in XML documents, hhhh is the code point in hexadecimal form and nnn is the code point in decimal form. The hhhh (or nnn) may be any number of hexadecimal (or decimal) digits and may include leading zeros. The hhhh for hexadecimal digits may mix uppercase and lowercase letters, though uppercase is the usual style. The XML and HTML standards restrict the usable code points to a set of valid values, which is a subset of UCS/Unicode code point values, that excludes all code points assigned to non-characters or to surrogates, and most code points assigned to C0 and C1 controls (with the exception of line separators and tabulations treated as white spaces). By contrast, a character entity reference refers to a sequence of one or more characters by the name of an entity which has the desired characters as its replacement text. The format is: &name; where name is the case-sensitive name of the entity. The semicolon is usually required in the character entity reference, unless marked otherwise in the table below (see ). The entity must either be predefined (built into the markup language), or declared in a Document Type Definition (DTD) by using <!ENTITY name "value">.
Standard public entity sets for characters XML XML specifies five predefined entities needed to support every printable ASCII character: &, <, >, ', and ". The trailing semicolon is mandatory in XML (and XHTML) for these five entities (even if HTML or SGML allows omitting it for some of them, according to their DTD). ISO Entity Sets SGML supplied a comprehensive set of entity declarations for characters widely used in Western technical and reference publishing, for Latin, Greek and Cyrillic scripts. The American Mathematical Society also contributed entities for mathematical characters (see ). HTML Entity Sets Early versions of HTML built in small subsets of these, relating to characters found in three Western 8-bit character sets. MathML Entity Sets The W3C developed a set of entity declarations for MathML characters. XML Entity Sets The W3C MathML Working Group took over maintenance of the ISO public entity sets, combined with the MathML and documents them in XML Entity Definitions for Characters. This set can support the requirements of XHTML, MathML and as an input to future versions of HTML. HTML5 HTML5 adopts the XML entities as named character references, and does not group them into sets. The character reference names originate from XML Entity Definitions for Characters. The HTML5 specification additionally provides mappings from the names to Unicode character sequences using JSON. Numerous other entity sets have been developed for special requirements, and for major and minority scripts. However, the advent of Unicode has largely superseded them.
Formal public identifiers for HTML DTD entities subsets The full formal public identifier and system identifier for the DTD entities subset (where the character entity name is defined) is actually mapped from one of the following three defined named entities:
Formal public identifiers for old ISO entities subsets The ISO entities subsets are old (documented) character subsets, which are given SGML character entity names in ISO 8879 and ISO 9573, and which were used in legacy encodings before the unification within ISO 10646. Their full formal public identifiers are as follows:
… excerpt ends here. Continue reading the full article.
