THE INDIA LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

DTD - Entities


Entities are used to define shortcuts to special characters.

Entities can be declared internal or external.


An Internal Entity Declaration

Syntax

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

Example

DTD Example:

<!ENTITY writer "Donald Duck.">
<!ENTITY copyright "Copyright Noidatut.">

XML example:

<author>&writer;&copyright;</author>

Note: An entity has three parts: an ampersand (&), an entity name, and a semicolon (;).


An External Entity Declaration

Syntax

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

Example

DTD Example:

<!ENTITY writer SYSTEM "https://www.noidatut.com/entities.dtd">
<!ENTITY copyright SYSTEM "https://www.noidatut.com/entities.dtd">

XML example:

<author>&writer;&copyright;</author>