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
DTD Declaration
B
XML Starting Line
C
None of these
D
XML Declaration
Question 2
<?xml version="1.0" encoding="ISO-8859-1"?>
Guess which version of XML is used ?
A
1st
B
3rd
C
4th
D
2nd
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
<bname>
D
<book>
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 can have more than one book
D
XML document forms a tree structure
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
4 Nodes and 2 Attributes
C
4 Nodes and 1 Attribute
D
2 Nodes and 2 Attributes
Question 5 Explanation: 
"category" is only atribute in the above xml document.
There are 5 questions to complete.