XML Attributes MCQ
This section focuses on "Attributes" 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. _______ are part of XML elements.
A. Document
B. Attributes
C. Tags
D. None of the above
View Answer
Ans : B
Explanation: Attributes are part of XML elements. An element can have multiple unique attributes. Attribute gives more information about XML elements.
2. An XML attribute is always a ________ pair.
A. name-value
B. name-attribute
C. name-tag
D. document-value
View Answer
Ans : A
Explanation: An XML attribute is always a name-value pair.
3. The name value should be in?
A. double (" ") quotes.
B. single () quotes.
C. double (" ") or single () quotes.
D. None of the above
View Answer
Ans : C
Explanation: value has to be in double (" ") or single () quotes.
4. Attributes are used to add a unique ________ to an element
A. tags
B. edges
C. label
D. flag
View Answer
Ans : C
Explanation: Attributes are used to add a unique label to an element, place the label in a category, add a Boolean flag, or otherwise associate it with some string of data.
5. How many types of enumerated attribute?
A. 2
B. 3
C. 4
D. 5
View Answer
Ans : A
Explanation: There are two types of enumerated attribute : NotationType and Enumeration.
6. NMTOKEN attribute used for?
A. It is used to specify the element as unique.
B. It indicates that the attribute will represent an external entity in the document.
C. It is similar to CDATA with restrictions on what data can be part of the attribute.
D. It is similar to CDATA with restrictions on what data can be part of the attribute.
View Answer
Ans : C
Explanation: NMTOKEN : It is similar to CDATA with restrictions on what data can be part of the attribute.
7. IDREFS attribute used for?
A. It is used to reference all IDs of an element.
B. It is used to reference an ID that has been named for another element.
C. It is used to specify the element as unique.
D. It indicates that the attribute will represent external entities in the document.
View Answer
Ans : A
Explanation: IDREFS : It is used to reference all IDs of an element.
8. CDATA attribute is?
A. StringType
B. Character data
C. Both A and B
D. None of the above
View Answer
Ans : C
Explanation: CDATA is a StringType. CDATA is character data. This means, any string of non-markup characters is a legal part of the attribute.
9. Which of the following are the predefined attributes?
A. xml:lang
B. xml:space
C. Both A and B
D. None of the above
View Answer
Ans : C
Explanation: xml:lang and xml:space are the predefined attributes.
10. Attribute of the document interface in DOM is/are?
A. doctype
B. implementation
C. documentElement
D. All of the above
View Answer
Ans : D
Explanation: Attribute of the document interface in DOM are all of the above.
Discussion