XML Character Entities
Home ] Up ] The Document Prolog ] XML Elements ] The Root Element ] XML Attributes ] Attribute vs. Element? ] Whitespace and Comments ] [ XML Character Entities ] CDATA Sections ] Processing Instructions ] Well-Formed Documents ]

 

 

Certain characters may not be used in XML content, because they are used in the XML syntax.  So, in order to specify these characters in XML content, you must use the corresponding Entity Reference:

Entity Reference Character
& &
&lt; <
&gt; >
&quot; "
&apos; '

You can enter a quote or an apostrophe within a quoted attribute value in the following ways:

<book title="Finnegan's Wake" />
<book title='Finnegan&apos;s Wake' />
<quote content='He said "Gadzooks!"' />
<quote content="He said &quot;Gadzooks!&quot;" />

Internal processing of an XML document is performed using Unicode. Numbered Character References (NCRs) may be used to select particular characters, using the following syntax:

&#n;

where n represents a (decimal) code point (character position) in the Unicode set.

You may also use the syntax:

&#xn;

where n is a hexadecimal number.

NCRs are not allowed in XML names.

For example:

<?xml version = "1.0" encoding = "utf-8"?>
<czech>
Jako efektivn&#x115;j&#x161;&#xED; se n&#xE1;m jev&#xED;
po&#x159;&#xE1;d&#xE1;n&#xED; tzv. Road Show
prost&#x159;ednictv&#xED;m na&#x161;ich autorizovan&#x1FD;ch
dealer&#x16F; v &#x10C;ech&#xE1;ch a na Morav&#x11B;, kter&#xE9;
prob&#x11B;hnou v pr&#x16F;b&#x16F;hu z&#xE1; &#x159;&#xED; a
&#x159;íjna.
</czech>

To see how your browser renders this, click here.

 
The page was last updated February 19, 2008