Difficulty: Easy
Correct Answer: Incorrect: absence of a DTD means “not DTD-valid,” but type validity is defined with respect to a schema
Explanation:
Introduction / Context:
XML validity terminology can be subtle. “Valid” under DTDs differs from “type-valid” under W3C XML Schema (XSD). This question mixes DTD presence with type validity, so we must disentangle the concepts.
Given Data / Assumptions:
Concept / Approach:
If a document references no DTD, it simply cannot be DTD-valid. However, type validity pertains to XML Schema: elements/attributes are checked against schema type definitions (simple/complex types). A document with no DTD can be type-valid if it conforms to its XSD; conversely, a document could be well-formed yet neither DTD-valid nor schema-valid if no validation is performed.
Step-by-Step Solution:
Verification / Alternative check:
Many systems validate XML against XSDs without ever using a DTD; editors and validators report “schema valid” even when no DTD is present.
Why Other Options Are Wrong:
Common Pitfalls:
Assuming “valid” always means DTD-valid. In modern practice, schema validity via XSD is more common and uses different terminology (types, facets, components).
Final Answer:
Incorrect: absence of a DTD means “not DTD-valid,” but type validity is defined with respect to a schema
Discussion & Comments