XML Tutorials - Herong's Tutorial Examples - Version 5.05, by Dr. Herong Yang
ENTITY - Entity Declaration Statement
This section describes syntax formats of the ENTITY statement, which is used to declare an XML entity. The ENTITY statement specifies what is the name of the entity and what is the replacement value.
ENTITY: is a DTD statement that defines an XML entity, and associates a value with the entity.
The syntax of ENTITY statement is:
<!ENTITY entity_name "entity_value">
Examples of ENTITY statements:
<!ENTITY author "Herong Yang"> <!ENTITY copyright "©">
Once an entity is defined, it can be used in any parsed text in the following form:
When an XML entity is encountered, the XML parser will replace it with its value defined in the ENTITY statement.
Note that XML language has 5 pre-defined entities, which can be used without declaring them in the document type:
Entity Character & & ' ' > > < < "e; "
Last update: 2014.
Table of Contents