Document Type Definitions
There are two types of XML parsers: validating and nonvalidating parsers. A nonvalidating parser checks an XML document to be sure that it's well formed, and returns it to you as a tree of objects. A validating parser, on the other hand, ensures the document is well formed, then checks it against its DTD or schema to determine whether it's valid. In this section, we'll discuss the first of these validation methods—the DTD.
A DTD is a somewhat antiquated although still widely used method of validating documents. DTDs have a peculiar and rather limited syntax, but are still found in lots of XML implementations. Over time, it's likely that XML schemas will become the tool of choice for setting up data validation. That said, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access