May 28, 2021 DTD
An entity is a variable that defines a shortcut that references normal text or special characters.
An entity reference is a reference to an entity.
Entities can be declared internally or externally.
<!ENTITY entity-name "entity-value">
DTD 实例:
<!ENTITY writer "Donald Duck.">
<!ENTITY copyright "Copyright w3cschool.cn">
XML 实例:
<author>&writer;©right;</author>
Note: An entity consists of three parts: a and a sign, an entity name, and a sign (;).
Tip: Internal entities are defined within the XML document, and the contents of the entities are given in the declaration. Internal entities are analyzed entities that do not have separate physical storage objects.
<!ENTITY entity-name SYSTEM "URI/URL">
DTD 实例:
<!ENTITY writer SYSTEM "//www.w3cschool.cn/entities.dtd">
<!ENTITY copyright SYSTEM "//www.w3cschool.cn/entities.dtd">
XML example:
<author>&writer;©right;</author>
Tip: External
entities are defined in separate (external) files and can be between analyzed or unanalysed entities.