Web Technologies - Old Questions

10.  Discuss public external declaration of DTD with example.

5 marks | Asked in 2071-II

In external DTD elements are declared outside the XML file.  

Public external DTDs are identified by the keyword PUBLIC and are intended for broad use. The "DTD_location" is used to find the public DTD if it cannot be located by the "DTD_name". Its syntax is:

<!DOCTYPE root_element PUBLIC "DTD_name" "DTD_location">.

where:

DTD_location: relative or absolute URL

DTD_name: follows the syntax:

    "prefix//owner_of_the_DTD//description_of_the_DTD//ISO 639_language_identifier".

If any elements, attributes, or entities are used in the XML document that are referenced or defined in an external DTD, standalone="no" must be included in the XML declarationvalidity constraint.

For example,

<?xml version="1.0" standalone="no" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
  "http://www.w3.org/TR/REC-html40/loose.dtd">