Open In App

GATE | GATE-IT-2004 | Question 89

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

intro.xml

<?xml version = \"1.0\"?>

<!DOCTYPE myMessage SYSTEM \"intro.dtd\"›

<myMessage>

<message>Welcome to XML</message>

</myMessage>

intro.dtd

<! 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
Please comment below if you find anything wrong in the above post

Article Tags :