Element Attribute - Quiz Explanation
The correct answers are indicated below, along with the text that explains the correct answers.
1.
According to SGML purists, it is better to embed useful information about elements between tags rather than within tags in XML. Such useful information includes classifications or descriptions that further define the specific behavior of the tag. When used in XML, what is this additional information about a given element called?
Please select the best answer.
A.
An element type
B.
An attribute type
C.
An input type
D.
A tag value
The correct answer is B.
The additional information about a given element is called an attribute type. Answer A is incorrect because element type contains primary, not additional information. Answer C is incorrect because an input type does not exist in XML. Answer D is incorrect because a tag value is the same as an element primary, not additional, value.
2.
What declaration is used in XML to declare multiple attributes?
Please select the best answer.
A.
The ELEMENT declaration
B.
The ELEMENT-ATTRIBUTES declaration
C.
The ATTRIBUTE reference
D.
The ATTRIBUTE-LIST declaration
The correct answer is D.
The ATTRIBUTE-LIST declaration is used to declare multiple attributes. Answer A is incorrect because an ELEMENT is used in DTD to declare elements, not attributes. Answer B and C are incorrect because there are no such declarations in a DTD.
3.
What does the DTD define to allow an XML document instance to use special characters and characters that may be misinterpreted?
Please select the best answer.
A.
The CHAR keyword
B.
Attribute values
C.
Parameter entities
D.
General entities
The correct answer is D.
The DTD defines general entities to allow an XML document to use special characters and characters that may be misinterpreted. Answer A is incorrect because the CHAR key word is not available in the definition of a DTD. Answer B is incorrect because attribute values describe additional properties of XML elements, not special characters. Answer C is incorrect because parameter entities are used to define special characters to be used inside the DTD, not in the XML document instance.
4.
What XML declaration will be used if an application requires validation of the maximum number of times an XML element is used in an XML document instance?
Please select the best answer.
A.
A DTD
B.
An XML schema
C.
An <!ELEMNT>
D.
An Attribute
The correct answer is B.
An XML schema will be used if an application requires validation of the maximum number of times an XML element is used in an XML document. Answer A is incorrect because the DTD does not have syntax for defining the minimum number of times and XML element is used. Answer C is incorrect because an <!ELEMENT> declaration is used in a DTD to declare the element name and any child elements it may have but not a minimum number of child elements. Answer D is incorrect because an attribute is a property of an element and has no relation to the minimum number of elements an XML document may have.