GATE | Gate IT 2005 | Question 80



Given below is an excerpt of an xml specification.

<Book>
<title> GATE 2005 </title>
<type value = "BROCHURE"/>
<accno>10237623786</accno>
</Book>
<Book>
<type value = "FICTION"/>
<accno>0024154807</accno>
</Book>
Given below are several possible excerpts from “library.dtd”. For which excerpt would the above specification be valid?

(A) <!ELEMENT Book (title+, type, accno)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT type EMPTY>
<!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)>
<!ELEMENT accno (#PCDATA)>
(B) <!ELEMENT Book (title?, type, accno)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT type ATTLIST>
<!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)>
<!ATTLIST accno value (#PCDATA)>
(C) <!ELEMENT Book (title*, type, accno)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT type ATTLIST>
<!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)>
<!ELEMENT accno (#PCDATA)>
(D) <!ELEMENT Book (title?, type, accno)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT type EMPTY>
<!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)>
<!ELEMENT accno (#PCDATA)>


Answer: (D)

Explanation:

Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.