Coding With Fun
Home Docker Django Node.js Articles FAQ

DTD entity

May 28, 2021 DTD

Table of contents

DTD - Entity

This section describes entity declarations in DTD, which are used when entity declarations are made in DTD THEENTITY keyword to declare.

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.

An internal entity declaration


<!ENTITY entity-name "entity-value">


DTD 实例:
<!ENTITY writer "Donald Duck.">
<!ENTITY copyright "Copyright">

XML 实例:


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.

An external entity declaration


<!ENTITY entity-name SYSTEM "URI/URL">


DTD 实例:

<!ENTITY writer SYSTEM "//">
<!ENTITY copyright SYSTEM "//">

XML example:

Tip: External entities are defined in separate (external) files and can be between analyzed or unanalysed entities.