In XML terminology, what is the component that defines the structure (allowed elements, attributes, order, and occurrence) of an XML document?
-
ADOCTYPE
-
BDTD
-
C#PCDATA
-
DHTML Stylesheet
Answer
Correct Answer: DTD
Explanation
Introduction / Context:XML relies on separate schema or DTD artifacts to define valid document structure. This question asks you to identify the component responsible for that structural definition.
Given Data / Assumptions:
- We want the artifact that declares elements, attributes, and content models.
- We are considering classic DTD usage.
Concept / Approach:A DTD (Document Type Definition) declares the allowable building blocks of an XML document. The DOCTYPE declaration in an XML file references or embeds a DTD, but the DTD itself is the structure definition.
Step-by-Step Solution:
Differentiate between DOCTYPE and DTD.DOCTYPE declares/links; DTD defines structure.Choose “DTD.”Verification / Alternative check:Looking at a DTD file shows ELEMENT and ATTLIST declarations that define permissible structure.
Why Other Options Are Wrong:
- DOCTYPE: the declaration that references a DTD, not the definition itself.
- #PCDATA: a token used inside DTDs to indicate parsed character data.
- HTML Stylesheet: unrelated to XML structure definition.
Common Pitfalls:Using “DOCTYPE” and “DTD” interchangeably; DOCTYPE is the declaration, DTD is the schema-like definition.
Final Answer:DTD