DTD basics: which keyword begins a Document Type Definition (DTD) declaration within an XML document?
Database
XML and ADO.NET
Difficulty: Easy
Choose an option
-
A#PCDATA
-
BXML
-
CDOCTYPE
-
DHTTPS
Answer
Correct Answer: DOCTYPE
Explanation
Introduction / Context:A DTD (Document Type Definition) specifies the valid structure of an XML document. When embedded or referenced from an XML document, the DTD is introduced with a specific keyword.
Given Data / Assumptions:
- We are dealing with an XML prolog and document type declaration.
- We need the correct starter keyword.
Concept / Approach:The document type declaration starts with the keyword DOCTYPE, possibly followed by the root element name and a system/public identifier pointing to the external DTD.
Step-by-Step Solution:
Recall the syntax: or PUBLIC identifiers.Identify “DOCTYPE” as the opener of the declaration.Choose “DOCTYPE.”Verification / Alternative check:Open any XML using DTD; the header shows .
Why Other Options Are Wrong:
- #PCDATA: denotes parsed character data in element declarations, not the DTD preamble.
- XML and HTTPS: unrelated to the DTD declaration keyword.
Common Pitfalls:Confusing DTD entity keywords (#PCDATA, ELEMENT, ATTLIST) with the top-level DOCTYPE declaration.
Final Answer:DOCTYPE