This chapter provides a quick tour of the main components of XML Schema. It also introduces a simple example of a schema and a conforming instance that will be used and built upon throughout the book.
Suppose you have the instance shown in Example 2–1. It consists of a
product element that has two children (
size) and an attribute (
<product effDate="2001-04-12"> <number>557</number> <size>10</size></product>
Example 2–2 shows a schema that might be used to validate our instance. Its three element declarations and one attribute declaration assign names and types to the components they declare.