DTD basics: which keyword begins a Document Type Definition (DTD) declaration within an XML document?

Difficulty: Easy

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

More Questions from XML and ADO.NET

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion