Document Type Definition (DTD) and application of DTD | Web Technologies

Download our Android App from Google Play Store and start reading Reference Notes Offline.

DTDDocument Type Definition (DTD) and it’s application,
Web Technologies Notes| Sixth Semester,
BSc.CSIT | Tribhuvan University (TU)

Document Type Definition (DTD)
Document Type Definition (DTD) is an approach for defining the structure of XML Document. It is an XML schema language whose purpose is to define legal building blocks of an XML document. It defines the document structure with a list of legal elements and attributes.

If the DTD is declared inside the XML file, it must be wrapped inside the definition. For example;

<?xml version="1.0"?>
<!DOCTYPE note [
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]>
<note>
<to>Digvijay</to>
<from>Bijay</from>
<heading>Invitation</heading>
<body>I have a birthday-party this Friday, please come.</body>
</note>

Application

  • Independent groups of people can agree on a standard DTD for interchanging data.
  • An application can use a standard DTD to verify that the data you receive from the outside world is valid.
  • To verify your own data

Question -> Create the HTML2 document with the paragraph using <p>, <h1>, <strong> for the first word for every sentence and <em>  for all the capital letters.

Answer->

<!DOCTYPE html>
<?xml version="1.0" encoding="UTF-8"?>
<html lang="en">
<head>
<title></title>
</head>
<body>
<h1>Famous Quotation</h1>
<p><strong><em>L</em>ife </strong>only has one rule:never quit.</br>
<strong><em>T</em>he </strong>best way to predict the future is to create it.</br>
<strong><em>T</em>here </strong> are no secrets to success. <strong><em>I</em>t </strong> is the result of preparation, hard work learning from failure.</p>
</body>
</html>

(Visited 201 times, 1 visits today)

Posted By : Digvijay | Comment RSS | Category : Sixth Semester
Tag :

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

Wordpress DMCA
Community | Toolbar | Android App | Founder/Developer : Hari Prasad Chaudhary | CSIT Portal Manager : Digvijay Chaudhary