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, ...

Get Guru's Guide to SQL Server™ Stored Procedures, XML, and HTML, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.