Before you start
This tutorial demonstrates the use of W3C XML Schema features in defining data formats for enterprise applications.
First, you'll learn the major types of enterprise applications and their data-interchange requirements, and why you need to define schema for enterprise XML data. You'll also learn the use of patterns to design high-level business documents and XML structures in enterprise applications. Then, using production data as an example, you will start to design an enterprise XML schema that uses various XML Schema features in enterprise data design. You'll learn:
- How to define and extend complex types
- When and how to define abstract complex types and abstract elements
- How to use regular expressions (string patterns), enumerations, unions, lists, and substitution groups
You'll also learn why and how to develop multiple file schemas, and about using external schemas to design your enterprise data. Finally, you will put the pieces together to design high-level business documents.
You should be able to write well formed XML 1.0 documents. You should also have a beginner-level understanding of XML schemas. This includes the ability to use simple types in XML schema to build complex types. See Resources for links to material you can read to fulfill these prerequisites.
The tutorial will be of value for you if you want to learn when and why to use important features in the XML Schema specification to design production-grade XML schemas for enterprise applications. You can also benefit from this tutorial if you want to learn how to reuse the experience of other schema designers.
The remainder of this tutorial is organized in the following sections:
- Explanation of types of enterprise applications and their requirements for data interchange. This section also explains why you need XML schema in your enterprise applications and introduces the use of XML design patterns.
- Demonstration of how to build complex types to represent production resources. This section also demonstrates how to group XML elements for substitution.
- Explanation of using regular expressions, enumerations, unions, lists, and substitution groups.
- Demonstration of developing a schema that spans multiple files. This section also explains how to use external schemas while you design your own schema.
- Demonstration of how to build a schema for high-level business documents comprising basic XML structures. This section also demonstrates the use of abstract elements with substitution groups to build an XML template.
A simple Java application named
InstanceVerifier is included in the source code download for this tutorial (see Download). You'll use
InstanceVerifier to validate XML instance documents against the XML schema you develop in this tutorial. The source code download also includes several XML instance documents to help you understand schema concepts.
InstanceVerifier uses XML schema support that comes with Java Development Kit (JDK) version 1.5. So, you must download and install JDK 1.5 from the Sun Web site to try the schema and instance documents developed in this tutorial (see Resources).