In the previous chapter, you saw that defining a vocabulary for the XML that you create or work with is an important step in any validation process. If you accept XML documents, you need the means to programmatically validate the structure of those XML documents. Validating an XML document means initiating a process to ensure that the XML document follows a set of rules regarding structure. It is quite difficult to process an XML document that is doesn't have the structure you expect.
In the previous chapter, you reviewed using DTDs — or document type definitions in XML validation. DTDs are the original way to describe the vocabulary of an XML document. If you look at the XML specification (found at
w3.org/TR/REC-xml/) you find that DTDs are included in this definition. You don't find the XML Schemas specifications defined in the XML specification. XML Schemas were defined after the creation of the XML specification.
The W3C made the XML Schema a recommendation in October of 2004. You can find the various specifications in the following places on the Internet:
XML Schemas are the default way to represent a vocabulary, and they are the best option for new development. This chapter looks at the basics of XML Schemas—including how to build and consume them.
The previous chapter reviews DTDs and ...