Totel:9 Click: 1 2
DTD is stands for Document Type Defintion. We use DTD in XML document to define the legal building blocks.
Using DTD we can also define the structure of an document with name of legal attributes and elements.
DTD has two types of declarations internal and external.I have given you brief information of internal and external DTD.
1. Internal DTD Declaration : I have given you a syntax using them you can declare internal DTD in our XML file.
<!DOCTYPE root-element [element-declarations]>
Example: Now I used internal DTD in XML file like that,
<!DOCTYPE note [
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
<body>Recently R4R given a VoiceBox facility using them you can chat with R4R</body>
Some main reasons to use DTD are given Below:
1. Using DTD XML files can write its description into its format.
2. DTD is an most acceptable standard using DTD different group members can interchange data each other.
3. Also, using DTD we can check the validity of our own data and the data that comes from different groups(other persons).
I have given you some building blocks that are used for making an XML and HTML document.The list are:
Main building block of an XML and HTML document are elements.
1. Elements : Elements may contain text, other elements or empty.Some empty HTML elements are "hr","img" and "br".
Some HTML elements are "head","body" and "title" etc.
Some XML elements are "main","from" and "to" etc.
<title>write here some text</title>
<body>write here some text</body>
<message>write here some text</message>
<to>write here some text</to>
2. Attributes : Attributes is used to give us more information about elements. We use attribute inside the open tag of element.
<img src="R4Rlogo.gif" />
In this example name of element and attribute is "img" and "src" respectively.And the value of this src attribute is "R4Rlogo.gif".
3. Entities : Entities are those special characters that we used in XML.We use this special characters to perform some specific task.
Some entities that we used in XML are:
Some entity reference are:
Some characters are:
4. PCDATA : Firstly I told you PCDATA is stands for parsed character data.
We can defined PCDATA as PCDATA is an text that is parsed through a parser.And we can analysed PCDATA text through the parer used for entities and markup.
5. CDATA : CDATA stands for character data.We can't parse the CDATA text through parser.Means that tags used inside CDATA text will not handle
CDATA text as markup and also we can't expend the entities.
DTD Objective Questions And Answers
DTD Interview Questions And Answers
R4R,DTD Objective fresher and experienced, DTD Subjective fresher and experienced ,DTD Interview Questions And Answers,DTD fresher and experienced,DTD Interview fresher and experienced ,DTD Questions fresher and experienced,DTD Answers fresher and experienced