DTD and type validity: Are documents without a DTD “not-type-valid” by definition, regardless of XML Schema validation?

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:

  • We consider two validation regimes: DTD-based and XSD-based.
  • “Type validity” is an XML Schema notion, not a DTD notion.
  • A document may have no DTD but still be validated against an XSD.


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:

Distinguish well-formedness (syntax) from validity (DTD) and type-validity (XSD typing).Note that DTD absence says nothing about XSD conformance.Conclude the statement is incorrect due to conflating DTDs with schema type validity.


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:

  • Tying type validity to DTD presence is conceptually wrong.
  • Namespaces or internal subsets do not alter these definitions.


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

More Questions from XML and ADO.NET

Discussion & Comments

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