Character, Entity, and Predefined Entity References

Character, entity, and predefined entity references refer respectively to (1) a specific character in the ISO/IEC 10646 or Unicode character set (especially one not readily accessible through the keyboard), (2) a named entity, and (3) any one of the five predefined XML entities.

Productions

[4] NameChar::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender 1.0
[4] NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] |
[#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] |
[#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] |
[#x10000-#xEFFFF] 1.1
[4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] |
[#x203F-#x2040] 1.1
[5] Name::= (Letter | '_' | ':') (NameChar)* 1.0
[5] Name ::= NameStartChar (NameChar)* 1.1
[66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'
[67] Reference ::= EntityRef | CharRef
[68] EntityRef ::= '&' Name ';'

Examples

<para>The &#182; symbol marks the beginning of a paragraph.</para>

<para>The &#xB6; symbol marks the beginning of a paragraph.</para>

<p>&copy; O'Reilly Media, Inc.</p>

<comparison>&quot;a &lt; b &gt; &amp; a=c&quot;
</comparison>

Description

In XML, character and entity references are formed by surrounding a numerical value or name with & and ;, as in &#xA9;, &#169;, or &copy;.

Character references

You can write character references in decimal or hexadecimal form, though each is written in ...

Get XML Pocket Reference, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.