Character entity reference
| This article may need to be rewritten entirely to comply with Wikipedia's quality standards. You can help. The discussion page may contain suggestions. (February 2012) |
|
|
It has been suggested that this article or section be merged into List of XML and HTML character entity references. (Discuss) Proposed since May 2010. |
| This article does not cite any references or sources. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. (August 2009) |
In the markup languages SGML and HTML, a character entity reference is a reference to a particular kind of named entity that has been predefined or explicitly declared in a Document Type Definition (DTD). The "replacement text" of the entity consists of a single character from the Universal Character Set/Unicode.
The purpose of a character entity reference is to provide a way to refer to a universal character a in a limited character encoding, like ASCII.
Although in popular usage character references are often called "entity references" or even "entities", this usage is wrong.[citation needed] A character reference is a reference to a character, not to an entity. Entity reference refers to the content of a named entity. An entity declaration is created by using the <!ENTITY name "value"> syntax in a document type definition (DTD) or XML schema. Then, the name defined in the entity declaration is subsequently used in the XML. When used in the XML, it is called an entity reference.
Contents |
[edit] Concepts
HTML and SGML have two relevant concepts:
[edit] Predefined entity
A "predefined entity reference" is a reference to one of the special characters denoted by:
| name | value | character | code (dec) | meaning |
|---|---|---|---|---|
| quot | " |
" | x22 (34) | (double) quotation mark |
| amp | & |
& | x26 (38) | ampersand |
| apos | ' |
' | x27 (39) | apostrophe (= apostrophe-quote) |
| lt | < |
< | x3C (60) | less-than sign |
| gt | > |
> | x3E (62) | greater-than sign |
[edit] Character coding
A "character reference" is a construct such as   or equally   that refers to a character by means of its numeric Unicode code point, i.e. here, the character code 160 (or xA0 in hexa) refers the character, the non-breaking space.
[edit] See also
- SGML entity
- Character encodings in HTML
- Numeric character reference
- List of XML and HTML character entity references
[edit] External links
- XML Entity Definitions for Characters (W3C Recommendation)
- Entities Table
- A Simple Character Entity Chart
- A character entity chart with images for entities
- A Clear and Quick Reference to HTML Symbol Entities Codes
- XHTML Character Entity Reference
| This World Wide Web-related article is a stub. You can help Wikipedia by expanding it. |