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
XML Starting Line
B
None of these
C
DTD Declaration
D
XML Declaration
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
<bname>
B
<pages>
C
<book>
D
<price>
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
It is a document that refers a single book
B
Document Syntax is Self Explanatory
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
4 Nodes and 2 Attributes
B
4 Nodes and 1 Attribute
C
2 Nodes and 2 Attributes
D
3 Nodes and 1 Attribute
Question 5 Explanation: 
"category" is only atribute in the above xml document.
There are 5 questions to complete.