DTD Entities In XML

XML Entities
• Entity references are references to entities.
• Entities as variables used to define shortcuts to common text.
• Entities can be declared internal.
• Entities can be declared external
Declaring an Internal Entity
<!ENTITY entity-name “entity-value”>
DTD Example:
<!ENTITY developer “[email protected]”>
<!ENTITY copyright ” Copyright 2016 www.csitquestions.com. All Rights Reserved “>
XML example:
Declaring an External Entity
<!ENTITY entity-name SYSTEM “URI/URL”>
DTD Example:
<!ENTITY developer SYSTEM “http://www.csitquestions.com/html/xml/entity.xml”>
<!ENTITY copyright SYSTEM ” http://www.csitquestions.com/html/xml/entity.xml “>
XML example: