XML Schemas

I mentioned earlier that DTDs were somewhat old-fashioned. The reason for this is that there's a newer, better technology for validating XML documents. It's called XML Schema. Unlike DTDs, you build XML Schema documents using XML. They consist of elements and attributes just like the XML documents they validate. They have a number of other advantages over DTDs, including the following.

  • DTDs cannot control what kind of information a given element or attribute can contain. Merely being able to specify that an element stores text is not precise enough for most business needs. We might want to specify what format the text should have or whether the text is a date or a number. XML Schema has extensive support for data domain control.

Get Guru's Guide to SQL Server Architecture and Internals, The now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.