Mastering XML Schemas
Please turn off all
What are Schemas?
About Schemas
What's Wrong with DTDs?
greeting.xml
greeting.xsd
Attaching the schema to the document without namespaces
Validating the document
An Invalid Document
Checking the Invalid Document
Schema Aware Parsers
Questions?
Complex vs. Simple Types
Four main schema elements:
A More Complex Document
A More Complex Schema
Validating the Song Document
Fixed Hot Cop
A Smaller Schema
Anonymous Types
Questions?
Data Typing
Possible types
The PSVI
Primitive Data Types for Schemas
Numeric Data Types for Schemas
Time Data Types for Schemas
XML Data Types for Schemas
Assorted Data Types for Schemas
Questions?
Derived Types
Deriving by restriction
Facets
Length Facets: length, minLength, maxLength
Facets for ordered items: minExclusive, maxExclusive, minInclusive, maxInclusive
whiteSpace
Facets for decimal numbers: totalDigits and fractionDigits
Enumeration
Adding a Price
The pattern facet
Regular Expressions
The Price Schema
Questions?
Complex Types
A Document with Attributes
Declaring Attributes
Element Content
Declaring Complex Types
Sharing Content Models
Questions?
When Order Doesn't Matter
The xsd:all Group
Choices
Mixed Content
Declaring Mixed Content
Sequences
Questions?
Schemas and Namespaces
Default Namespace
The targetNamespace attribute
A Song with a Namespace
A Schema for a Document that Uses the Default Namespace
Multiple Namespaces, Multiple Schemas
XLink Schema
Song Schema with XLink Support
Questions?
Annotations
What Schemas don't do
W3C XML Schema Language Alternatives
Schematron
A Schematron schema for songs
RELAX NG
A RELAX-NG Song Schema
Non-XML RELAX NG Syntax
Hook
Examplotron
DTDs aren't Dead!
To Learn More
Questions?
Entire Presentation as Single File
Start
|
Cafe con Leche
Copyright 2000-2003, 2006 Elliotte Rusty Harold
Last Modified January 3, 2006