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 Features
- Lecture 0
- Quiz 0
- Duration 2 Days
- Skill level All levels
- Language English
- Students 0
- Assessments Yes
Module 1. Introduction to XML Schema
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
Simple Types
- Simple and Atomic Types
- Built-In Types
- Primitives
- Numeric Derived Types
- String Derived Types
- Simple Type Restriction
- Facets
- Enumerations
- Patterns
- Lists
- Unions
- Nillable Values
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
Keys and Key References
- Schema as Object Models
- UML for XML
- Composition
- Association
- Identity Constraints
- Asserting Uniqueness
- Keys and Key References
- Controlling Association Cardinality
Reusing Schema Types
- Type Specialization
- Extending Complex Types
- Using Extended Types
- Derivation by Restriction
- Abstract Types
- Substitution Groups
- “Complete” Specialization (The final Attribute)
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)
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