Computer Science, asked by Romanova, 1 year ago

what is the different between internal DTD and external DTD in xml ?

Answers

Answered by NabasishGogoi
4
Internal DTD : You can write rules inside XML document using declaration.
External DTD : You can write rules in a separate file (with .dtd extension).
Answered by StaceeLichtenstein
0

Difference between internal DTD and external DTD in xml  is given below.

Explanation:

Internal DTD

  • In the internal DTD the XML file is defined inside it.
  • The DTD file is wrapped  under the interpretation of <! DOCTYPE > tag.

For example :

<?xml version="1.0"?>

<!DOCTYPE Test  [

<!ELEMENT Test (id,name)>

<!ELEMENT id (#PCDATA)>

<!ELEMENT name(#PCDATA)>

<Test>

<id>13</id>

<name>san</name>

</Test>

External DTD

  • In the External DTD the XML file is defined outside it.
  • In this the <!doctype > tag must contains the address of external XML file.

For example :

<?xml version="1.0"?>

<!DOCTYPE Test SYSTEM "Test.dtd">

<Test>

<id>13</id>

<name>san</name>

</Test>

Test.dtd file

<!ELEMENT Test (id,name)>

<!ELEMENT id (#PCDATA)>

<!ELEMENT name(#PCDATA)>

Learn More :

  • brainly.in/question/3048388
Similar questions