XML Declaration MCQ
This section focuses on "Declaration" in XML. These Multiple Choice Questions (MCQ) should be practiced to improve the XML skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exams and other competitive examinations.
1. ___________ contains details that prepare an XML processor to parse the XML document.
A. XML document
B. XML declaration
C. Both A and B
D. None of the above
View Answer
Ans : B
Explanation: XML declaration contains details that prepare an XML processor to parse the XML document.
2. It informs the parser whether the document relies on the information from an external source?
A. Version
B. Encoding
C. Decoding
D. Standalone
View Answer
Ans : D
Explanation: It informs the parser whether the document relies on the information from an external source, such as external document type definition (DTD), for its content.
3. What is default value for Standalone?
A. Yes
B. No
C. Can't say
D. No default value
View Answer
Ans : B
Explanation: The default value is set to no. Setting it to yes tells the processor there are no external declarations required for parsing the document.
4. Which of the following is not correct Parameter_value for encoding?
A. ISO-10646-UCS-2
B. ISO-10646-UCS-4
C. Shift_JIA
D. EUC-JP
View Answer
Ans : C
Explanation: Shift_JIA is not correct Parameter_value for encoding. Instead of that Shift_JIS is correct.
5. Which is the parameter value for version?
A. 0.1
B. 1
C. 1.1
D. 2
View Answer
Ans : A
Explanation: 1.0 is the parameter value for Version.
6. Which of the following are correct rule for XML declaration?
A. If the XML declaration is included, it must contain version number attribute.
B. Either single or double quotes may be used.
C. The XML declaration has no closing tag
D. All of the above
View Answer
Ans : D
Explanation: All of the above statement are true.
7. What is XML declaration with no parameters?
A. <?xml >
B. <?xml />
C. <xml >
D. <xml ?>
View Answer
Ans : A
Explanation: XML declaration with no parameters : <?xml >
8. An element declaration specifies
A. a single markup element
B. zmarkup elements
C. markup data
D. the document data
View Answer
Ans : A
Explanation: An element declaration specifies a single markup element.
9. Attribute standalone="no" should be included in XML declaration if a document.
A. is linked to an external XSL stylesheet
B. has external general references
C. has processing instructions
D. has an external DTD
View Answer
Ans : D
Explanation: Attribute standalone="no" should be included in XML declaration if a document: has an external DTD.
10. Which of the following are not correct rule of XML declaration?
A. The names are always in lower case.
B. The Parameter names and values are not case-sensitive.
C. The correct order is: version, encoding and standalone.
D. None of the above
View Answer
Ans : B
Explanation: The Parameter names and values are case-sensitive is true.
Discussion