DTD - Entity
Entities are variables used to define shortcuts that reference normal text or special characters.
An entity reference is a reference to an entity.
Entities can be declared internally or externally.
An internal entity declaration
Syntax
<!ENTITY entity-name "entity-value">
Example
DTD Example:
<!ENTITY writer "Donald Duck.">
<!ENTITY copyright "Copyright W3CSchool .cc">
XML example:
<author>&writer;©right;</author>
<!ENTITY writer "Donald Duck.">
<!ENTITY copyright "Copyright W3CSchool .cc">
XML example:
<author>&writer;©right;</author>
##Note: An entity consists of three parts: an ampersand (&), an entity name, and a semicolon (;).
An external entity declarationSyntax
<!ENTITY entity-name SYSTEM "URI/URL">
ExampleDTD Example:
<!ENTITY writer SYSTEM "http://www.w3cschool.cc/entities.dtd">
< !ENTITY copyright SYSTEM "http://www.w3cschool.cc/entities.dtd">
XML example:
<author>&writer;©right;</author>
<!ENTITY writer SYSTEM "http://www.w3cschool.cc/entities.dtd">
< !ENTITY copyright SYSTEM "http://www.w3cschool.cc/entities.dtd">
XML example:
<author>&writer;©right;</author>