Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

How to declare DTD?
 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.
Syntax:
<!DOCTYPE root-element [element-declarations]>
Example: Now I used internal DTD in XML file like that,
<?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>Abhi</to>
  <from>Sudd</from>
  <heading>Message</heading>
  <body>Recently R4R given a VoiceBox facility using them you can chat with R4R</body>
</note>
 
Posted By: Name:Rajesh Kr URL: How to declare DTD?