XML MCQ : Guess the Output (Multiple Choice Questions)


Question 1
<?xml version="1.0" encoding="ISO-8859-1"?>
above line of code is used for ?
A
None of these
B
DTD Declaration
C
XML Declaration
D
XML Starting Line
Question 2
<?xml version="1.0" encoding="ISO-8859-1"?>
Guess which version of XML is used ?
A
2nd
B
1st
C
4th
D
3rd
Question 3
<?xml version="1.0" encoding="ISO-8859-1"?>
<book>
  <bname>XML Tutorials</bname>
  <pages>100</pages>
  <price>$300.00</price>
</book>
Which of the Node is considered as root node ?
A
<price>
B
<pages>
C
<book>
D
<bname>
Question 4
<?xml version="1.0" encoding="ISO-8859-1"?>
<book>
  <bname>XML Tutorials</bname>
  <pages>100</pages>
  <price>$300.00</price>
</book>
Which of the following statement is false if we consider above XML document ?
A
Document Syntax is Self Explanatory
B
It is a document that refers a single book
C
XML document forms a tree structure
D
XML document can have more than one book
Question 4 Explanation: 
Statement is partially true. We can have multiple book nodes in xml document but we need to modify syntax like this -
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book>
  <bname>XML Tutorials</bname>
  <pages>100</pages>
  <price>$300.00</price>
</book>
<book>
  <bname>XML Tutorials</bname>
  <pages>100</pages>
  <price>$300.00</price>
</book>
</bookstore>
Question 5
<book category="Web">
  <bname>XML Tutorials</bname>
  <pages>100</pages>
  <price>$300.00</price>
</book>
How many nodes and attributes are there in the document ?
A
3 Nodes and 1 Attribute
B
2 Nodes and 2 Attributes
C
4 Nodes and 1 Attribute
D
4 Nodes and 2 Attributes
Question 5 Explanation: 
"category" is only atribute in the above xml document.
There are 5 questions to complete.