GATE | GATE-IT-2004 | Question 89

Consider an XML file called intro.xml and a document type defintion (DTD) file intro.dtd as follows:


<?xml version = "1.0"?>

<!DOCTYPE myMessage SYSTEM "intro.dtd"›


<message>Welcome to XML</message>



<! ELEMENT myMessage (message)>

<! ELEMENT message (#PCDATA)>

A validating parser will classify intro.xml as
(A) Well-formed and validated
(B) Well-formed but not validated
(C) Validated but not well-formed

Answer: (A)

Explanation: The difference between well-formed and valid XML is simple: Valid XML has a DTD associated with it and has been verified against all the rules contained in the DTD in addition to being well-formed. Merely well-formed XML, on the other hand, is not necessarily valid, although it may be. In order to know the rules for a well formed document click here

Quiz of this Question

Recommended Posts:

0 Average Difficulty : 0/5.0
No votes yet.