Chapter 6: XML Schemas


Overview

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 http://www.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:

  • q XML Schema Part 0: Primer- http://www.w3.org/TR/xmlschema-0/

  • q XML Schema Part 1: Structures- http://www.w3.org/TR/xmlschema-1/

  • q XML Schema Part 2: Datatypes- http://www.w3.org/TR/xmlschema-2/

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.




Professional XML
Professional XML (Programmer to Programmer)
ISBN: 0471777773
EAN: 2147483647
Year: 2004
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net