Database Reference
In-Depth Information
used to validate them? What is the schema of all of the schemas? There is such a document;
the mother of all schemas is located at www.w3.org . All XML Schema documents are validated
against this document.
XML Schema is a broad and complex topic. Dozens of sizable topics have been written
just on XML Schema alone. Clearly, we will not be able to discuss even the major topics of XML
Schema in this chapter. Instead, we will focus on a few basic terms and concepts and show
how those terms and concepts are used with database processing. Given this introduction,
you will then be able to learn more on your own.
By ThE WAy XML Schema validation requires thinking at two meta levels. To understand
why, recall that metadata is data about data. The statement CUSTOMER
contains column CustomerLastName Char(25) is metadata. Extending this idea, the
statement SQL has a data type Char(n) for defining character data of length n is data
about metadata, or meta-metadata.
XML has the same meta levels. An XML document has a structure that is defined
by an XML Schema document. The XML Schema document contains metadata be-
cause it is data about the structure of other XML documents. But an XML Schema
document has its own structure that is defined by another XML Schema. That XML
Schema document is data about metadata, or meta-metadata.
The XML case is elegant. You can write a program to validate an XML document
(but don't—use one of the hundreds that already exist). Once you have such a pro-
gram, you can validate any XML document against its XML Schema document. The
process is exactly the same, regardless of whether you are validating an XML docu-
ment, an XML Schema document, or a document at any other level.
XML Schema Validation
Figure 11-51(a) shows a simple XML Schema document that can be used to represent a single
row from the ARTIST table at View Ridge Gallery. The second line indicates what schema is
to be used to validate this document. Because this is an XML Schema document, it is to be
validated against the mother of all schemas, the one at www.w3.org . This same reference will
be used in all XML Schemas, in every company, worldwide. (By the way, this reference address
is used only for identification purposes. Because this schema is so widely used, most schema
validation programs have their own built-in copy of it.)
Figure 11-51
Use of an XML Schema
(a) XML Schema Document
 
Search WWH ::




Custom Search