517. XML Schema
Rev. 1.0.6
This course is now available directly from our partner, Capstone Courseware.
This course gives the student who knows the fundamentals of XML a
detailed introduction to the XML Schema standard for defining document type
information.
The first module introduces the new XML Schema recommendation. Students review the shortcomings of the DTD
for expressing type information, and learn how to use XML Schema to create
strict document models. Schema data
types and structures are studied, allowing precise grammar and validation rules
to be defined for document content.
A second module offers intermediate-to-advanced instruction in
effective use of the new XML Schema recommendation. Students build skills in use of keys and key
references to associate elements based on key fields; cover complex-type extension; use of multiple namespaces and schema; and finally a chapter in best-practices in
schema design.
LEARNING OBJECTIVES
·
Develop XML Schema to express precise type
information for an XML document.
·
Associate schema with XML instance documents.
·
Validate instance documents against associated
schema.
·
Define simple types, and use value restrictions
and enumerations to constrain values.
·
Define list types and union types.
·
Create complex types, including simple types and
other complex types, and empty- and mixed-content types.
·
Define element and attribute groups for better
reuse and more maintainable schema.
·
Associate elements of different types using keys
and key references.
·
Create derived simple and complex types using
restriction and/or extension.
·
Develop hierarchies of reusable complex types
using type extension.
·
Populate multiple namespaces using schema, and
import and use those namespaces in valid instance documents.
·
Design schema that maximize validation
capabilities and type reuse.
·
Use XSLT as an additional stage of document
validation, to catch patterns that XML Schema cannot be used to express.
Course Duration: 2 days
Prerequisites: A basic knowledge of XML, such as
provided by Object Innovations Course 501.
Module 1: Introduction to
XML Schema
1.
Getting Started with XML Schema
What is an XML schema?
Schemas vs. DTDs
Structure of a Schema
Associating Schema with Documents
Types of Types
Defining Elements
Defining Complex Types
Validation
2.
Simple Types
Simple and Atomic Types
Built-In Types
Primitives
Numeric Derived Types
String Derived Types
Simple Type Restriction
Facets
Value Ranges
Enumerations
Patterns
Lists
Unions
Nillable Values
3.
Complex Types
Model Groups
Sequences, Conjunctions, and Disjunctions
Particles
Occurrence Constraints
Global and Local Definitions
Defining Attributes
Empty, Any, and Mixed Content
Model Group Definitions
Attribute Group Definitions
Annotations
Module 2: Advanced XML
Schema
1.
Keys and Key References
Schema as Object Models
UML for XML
Composition
Association
Identity Constraints
Asserting Uniqueness
Keys and Key References
Controlling Association Cardinality
2.
Reusing Schema Types
Type Specialization
Extending Complex Types
Using Extended Types
Derivation by Restriction
Abstract Types
Substitution Groups
“Complete” Specialization (The final
Attribute)
3.
Namespaces and Schema
Using Namespaces in Documents
Populating a Namespace
Qualified and Unqualified Locals
Multiple Namespaces in Schema
Importing and Including Schema
Multiple Schema per Namespace
Validating by Namespace (Wildcards)
4.
Using Schema in XML Applications
Schema Design Issues
Type Granularity
Ease of Parsing, Transformation, Presentation and Maintenance
Mapping from Object Models
Mapping from Database Schema
Foreign-Key Relationships
XSLT for Validation
Application Validation
Appendix A. Learning
Resources
Appendix B. Quick Reference:
W3C Namespaces
System Requirements
Software for this course can be installed and run on Windows or
Linux systems. A few small packages of
XML tools must be installed for parsing and schema validation – these require a
Java Runtime Environment, version 1.4.2.
Hardware requirements are not great;
a good minimal system for this course would have a Pentium 500MHz or
equivalent CPU, 128meg of RAM and at least 50 megabytes of free disk space for
tools installation.