Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
XML Schema
SPECIAL OFFER: Upgrade this ebook with O’Reilly
A Note Regarding Supplemental Files
Preface
Who Should Read This Book?
Who Should Not Read This Book?
About the Examples
Organization of This Book
Conventions Used in This Book
How to Contact Us
Acknowledgments
1. Schema Uses and Development
What Schemas Do for XML
Validation
Documentation
Querying Support
Data Binding
Guided Editing
W3C XML Schema
2. Our First Schema
The Instance Document
Our First Schema
First Findings
W3C XML Schema Is Modular
W3C XML Schema Is Both About Structure and Datatyping
Flat Design, Global Components
3. Giving Some Depth to Our First Schema
Working From the Structure of the Instance Document
New Lessons
Depth Versus Modularity?
Russian Doll and Object-Oriented Design
Where Have the Element Types Gone?
4. Using Predefined Simple Datatypes
Lexical and Value Spaces
Whitespace Processing
String Datatypes
No Whitespace Replacement
Normalized Strings
Collapsed Strings
Tokenss
Qualified names
URIs
Notations
Binary string-encoded datatypes
Numeric Datatypes
Decimal Types
Float Datatypes
xs:boolean
Date and Time Datatypes
The Realm of ISO 8601
Datatypes
List Types
What About anySimpleType?
Back to Our Library
5. Creating Simple Datatypes
Derivation By Restriction
Facets
Whitespace collapsed strings
xs:enumeration
xs:length
xs:maxLength
xs:minLength
xs:pattern
Other strings
xs:whiteSpace
Float datatypes
xs:enumeration
xs:maxExclusive
xs:maxInclusive
xs:minExclusive
xs:minInclusive
xs:pattern
Date and time datatypes
xs:enumeration
xs:maxExclusive
xs:maxInclusive
xs:minExclusive
xs:minInclusive
xs:pattern
Integer and derived datatypes
xs:totalDigits
Decimals
xs:fractionDigits
Booleans
xs:pattern
List datatypes
Multiple Restrictions and Fixed Attribute
Facet that can be changed but needs to be more restrictive
Facet that cannot be changed
Facet that performs the intersection of the lexical spaces
Facet that does its job before the lexical space
Fixed facets
Derivation By List
List Datatypes
Derivation By Union
Some Oddities of Simple Types
Beware of the Order
Using or Abusing Lists to Change the Behavior of Length Constraining Facets
Back to Our Library
6. Using Regular Expressions to Specify Simple Datatypes
The Swiss Army Knife
The Simplest Possible Patterns
Quantifying
More Atoms
Special Characters
Wildcard
Character Classes
Classical Perl character classes
Unicode character classes
User-defined character classes
Oring and Grouping
Common Patterns
String Datatypes
Unicode blocks
Counting words
URIs
Numeric and Float Types
Leading zeros
Fixed format
Datetimes
Time zones
Back to Our Library
7. Creating Complex Datatypes
Simple Versus Complex Types
Examining the Landscape
Content Models
Named Versus Anonymous Types
Creation Versus Derivation
Simple Content Models
Creation of Simple Content Models
Derivation from Simple Contents
Derivation by extension
Derivation by restriction
Comparison of these two methods
Complex Content Models
Creation of Complex Content
Compositors and particles
Element and attribute groups
Unique Particle Attribution Rule
Consistent Declaration Rule
Limitations on unordered content models
Limitations of xs:all
Adapting the structure of your document
Using xs:choice instead of xs:all
Derivation of Complex Content
Derivation by extension
Derivation by restriction
Asymmetry of these two methods
Mixed Content Models
Creating Mixed Content Models
Derivation of Mixed Content Models
Derivation by extension
Derivation by restriction
Derivation between complex and mixed content models
Empty Content Models
Creation of Empty Content Models
As simple content models
As complex content models
Derivation of Empty Content Models
Derivation by extension
Derivation by restriction
Simple or Complex Content Models for Empty Content Models?
Back to Our Library
Derivation or Groups
8. Creating Building Blocks
Schema Inclusion
Schema Inclusion with Redefinition
Redefining of Simple and Complex Types
Redefinition of Element and Attribute Groups
Extension
Restriction
Other Alternatives
External Parsed Entities
XInclude
Simplifying the Library
9. Defining Uniqueness, Keys, and Key References
xs:ID and xs:IDREF
XPath-Based Identity Checks
Uniqueness
Composite Fields
Keys
Key References
Permitted XPath Expressions
ID/IDREF Versus xs:key/xs:keyref
Using xs:key and xs:unique As Co-occurrence Constraints
10. Controlling Namespaces
Namespaces Present Two Challenges to Schema Languages
Namespace Declarations
To Qualify Or Not to Qualify?
Disruptive Attributes
Namespaces and XPath Expressions
Referencing Other Namespaces
Schemas for XML, XML Base and XLink
XML Attributes
XLink Attributes
Namespace Behavior of Imported Components
Importing Schemas with No Namespaces
Chameleon Design
Allowing Any Elements or Attributes from a Particular Namespace
11. Referencing Schemas and Schema Datatypes in XML Documents
Associating Schemas with Instance Documents
Defining Element Types
Defining Simple Types
Defining Complex Types
Defining Nil (Null) Values
Beware the Intrusive Nature of These Features...
12. Creating More Building Blocks Using Object-Oriented Features
Substitution Groups
Using a “Traditional” Group
Substitution Groups
Using substitution groups
Abstract elements
Trees of substitution groups
Traditional Declarations or Substitution Groups?
Fuzzy Recommendation
Extension of xs:choice through group redefinitions
Restricting substitution groups
Controlling Derivations
Attributes
Elements
Block attribute
Final elements
Abstract elements
Complex Types
Blocking complex types
Final complex types
Abstract complex types
Simple Types
Other Components and Redefinitions
13. Creating Extensible Schemas
Extensible Schemas
Global Components
Elements
Attributes
final and fixed Attributes
Splitting Schema Components
The Need for Open Schemas
xsi:type
Wildcards
And Substitution Groups?
14. Documenting Schemas
Style Matters
Keep It Simple
Think Globally
When It’s Similar, Show It
The W3C XML Schema Annotation Element
Foreign Attributes
XML 1.0 Comments
Which One and What For?
15. Elements Reference Guide
xs:all(outside a group)
xs:all(within a group)
xs:annotation
xs:any
xs:anyAttribute
xs:appinfo
xs:attribute(global definition)
xs:attribute(reference or local definition)
xs:attributeGroup(global definition)
xs:attributeGroup(reference)
xs:choice(outside a group)
xs:choice(within a group)
xs:complexContent
xs:complexType(global definition)
xs:complexType(local definition)
xs:documentation
xs:element(global definition)
xs:element(within xs:all)
xs:element(reference or local definition)
xs:enumeration
xs:extension(simple content)
xs:extension(complex content)
xs:field
xs:fractionDigits
xs:group(definition)
xs:group(reference)
xs:import
xs:include
xs:key
xs:keyref
xs:length
xs:list
xs:maxExclusive
xs:maxInclusive
xs:maxLength
xs:minExclusive
xs:minInclusive
xs:minLength
xs:notation
xs:pattern
xs:redefine
xs:restriction(simple type)
xs:restriction(simple content)
xs:restriction(complex content)
xs:schema
xs:selector
xs:sequence(outside a group)
xs:sequence(within a group)
xs:simpleContent
xs:simpleType(global definition)
xs:simpleType(local definition)
xs:totalDigits
xs:union
xs:unique
xs:whiteSpace
16. Datatype Reference Guide
xs:anyURI
xs:base64Binary
xs:boolean
xs:byte
xs:date
xs:dateTime
xs:decimal
xs:double
xs:duration
xs:ENTITIES
xs:ENTITY
xs:float
xs:gDay
xs:gMonth
xs:gMonthDay
xs:gYear
xs:gYearMonth
xs:hexBinary
xs:ID
xs:IDREF
xs:IDREFS
xs:int
xs:integer
xs:language
xs:long
xs:Name
xs:NCName
xs:negativeInteger
xs:NMTOKEN
xs:NMTOKENS
xs:nonNegativeInteger
xs:nonPositiveInteger
xs:normalizedString
xs:NOTATION
xs:positiveInteger
xs:QName
xs:short
xs:string
xs:time
xs:token
xs:unsignedByte
xs:unsignedInt
xs:unsignedLong
xs:unsignedShort
A. XML Schema Languages
What Is a XML Schema Language?
XML Schema Languages Are Not Schemas
Firewalls Against Diversity
Intrusive Modeling Tools
Early Binding Tools
Classification of XML Schema Languages
Rule-Based XML Schema Languages
Grammar-Based XML Schema Languages
Object-Oriented XML Schema Languages
A Short History of XML Schema Languages
The DTD Family
The W3C XML Schema Family
The RELAX NG Family
Schematron
Examplotron
Sample Application
XML DTDs
Example
W3C XML Schema
Example
RELAX NG
Example
Schematron
Example
Examplotron
Example
Decisions
B. Work in Progress
W3C Projects
XPath, XSLT, and XQuery
DOM
RDF
ISO: DSDL
Other
PSVI Serialization
APIs
Schema Extensions: Error Messages
Glossary
Index
About the Author
Colophon
SPECIAL OFFER: Upgrade this ebook with O’Reilly
← Prev
Back
Next →
← Prev
Back
Next →