Book description
If you need to create or use formal descriptions of XML vocabularies, the W3C's XML Schema offers a powerful set of tools for defining acceptable document structures and content. An alternative to DTDs as the way to describe and validate data in an XML environment, XML Schema enables developers to create precise descriptions with a richer set of datatypes?such as booleans, numbers, currencies, dates and times?that are essential for today?s applications.Schemas are powerful, but that power comes with substantial complexity. This concise book explains the ins and outs of XML Schema, including design choices, best practices, and limitations. Particularly valuable are discussions of how the type structures fit with existing database and object-oriented program contexts. With XML Schema, you can define acceptable content models and annotate those models with additional type information, making them more readily bound to programs and objects. Schemas combine the easy interchange of text-based XML with the more stringent requirements of data exchange, and make it easier to validate documents based on namespaces.You?ll find plenty of examples in this book that demonstrate the details necessary for precise vocabulary definitions. Topics include:
- Foundations of XML Schema syntax
- Flat, "russian-doll", and other schema approaches
- Working with simple and complex types in a variety of contexts
- The built-in datatypes provided by XML Schema
- Using facets to extend datatypes, including regular expression-based patterns
- Using keys and uniqueness rules to limit how and where information may appear
- Creating extensible schemas and managing extensibility
- Documenting schemas and extending XML Schema capabilities through annotations
Publisher resources
Table of contents
- A Note Regarding Supplemental Files
- Preface
- 1. Schema Uses and Development
- 2. Our First Schema
- 3. Giving Some Depth to Our First Schema
- 4. Using Predefined Simple Datatypes
-
5. Creating Simple Datatypes
- Derivation By Restriction
- Derivation By List
- Derivation By Union
- Some Oddities of Simple Types
- Back to Our Library
- 6. Using Regular Expressions to Specify Simple Datatypes
- 7. Creating Complex Datatypes
- 8. Creating Building Blocks
- 9. Defining Uniqueness, Keys, and Key References
-
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
- 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
- 12. Creating More Building Blocks Using Object-Oriented Features
- 13. Creating Extensible Schemas
- 14. Documenting Schemas
-
15. Elements Reference Guide
- xs:all(outside a group) — Compositor describing an unordered group of elements.
- xs:all(within a group) — Compositor describing an unordered group of elements. The number of occurrences cannot be defined when xs:all is used within a group.
- xs:annotation — Informative data for human or electronic agents.
- xs:any — Wildcard to replace any element.
- xs:anyAttribute — Wildcard to replace any attribute.
- xs:appinfo — Information for applications.
- xs:attribute(global definition) — Global attribute definition that can be referenced within the same schema by other schemas.
- xs:attribute(reference or local definition) — Reference to a global attribute definition or local definition (local definitions cannot be referenced).
- xs:attributeGroup(global definition) — Global attributes group declaration that can be referenced within the same schema by other schemas.
- xs:attributeGroup(reference) — Reference to a global attributes group declaration.
- xs:choice(outside a group) — Compositor to define group of mutually exclusive elements or compositors.
- xs:choice(within a group) — Compositor to define group of mutually exclusive elements or compositors. The number of occurrences cannot be defined when xs:choice is used within a group.
- xs:complexContent — Definition of a complex content by derivation of a complex type.
- xs:complexType(global definition) — Global definition of a complex type that can be referenced within the same schema by other schemas.
- xs:complexType(local definition) — Complex type local definition (local definitions cannot be referenced).
- xs:documentation — Human-targeted documentation.
- xs:element(global definition) — Global element definition that can be referenced within the same schema by other schemas.
- xs:element(within xs:all) — Reference to a global element declaration or local definition (local definitions cannot be referenced). The number of occurrences can only be zero or one when xs:element is used within xs:all..
- xs:element(reference or local definition) — Reference to a global element declaration or local definition (local definitions cannot be referenced).
- xs:enumeration — Facet to restrict a datatype to a finite set of values.
- xs:extension(simple content) — Extension of a simple content model.
- xs:extension(complex content) — Extension of a complex content model.
- xs:field — Definition of the field to use for a uniqueness constraint.
- xs:fractionDigits — Facet to define the number of fractional digits of a numerical datatype.
- xs:group(definition) — Global elements group declaration that can be referenced within the same schema by other schemas.
- xs:group(reference) — Reference to a global elements group declaration or local definition (local definitions cannot be referenced).
- xs:import — Import of a W3C XML Schema for another namespace.
- xs:include — Inclusion of a W3C XML Schema for the same target namespace.
- xs:key — Definition of a key.
- xs:keyref — Definition of a key reference.
- xs:length — Facet to define the length of a value.
- xs:list — Derivation by list.
- xs:maxExclusive — Facet to define a maximum (exclusive) value.
- xs:maxInclusive — Facet to define a maximum (inclusive) value.
- xs:maxLength — Facet to define a maximum length.
- xs:minExclusive — Facet to define a minimum (exclusive) value.
- xs:minInclusive — Facet to define a minimum (inclusive) value.
- xs:minLength — Facet to define a minimum length.
- xs:notation — Declaration of a notation.
- xs:pattern — Facet to define a regular expression pattern constraint.
- xs:redefine — Inclusion of a W3C XML Schema for the same namespace with possible override.
- xs:restriction(simple type) — Derivation of a simple datatype by restriction.
- xs:restriction(simple content) — Derivation of a simple content model by restriction.
- xs:restriction(complex content) — Derivation of a complex content model by restriction.
- xs:schema — Document element of a W3C XML Schema.
- xs:selector — Definition of the the path selecting an element for a uniqueness constraint.
- xs:sequence(outside a group) — Compositor to define an ordered group of elements.
- xs:sequence(within a group) — Compositor to define an ordered group of elements. The number of occurrences cannot be defined when xs:all is used within a group.
- xs:simpleContent — Simple content model declaration.
- xs:simpleType(global definition) — Global simple type declaration that can be referenced within the same schema by other schemas.
- xs:simpleType(local definition) — Local simple type definition (local definitions cannot be referenced).
- xs:totalDigits — Facet to define the total number of digits of a numeric datatype.
- xs:union — Derivation of simple datatypes by union.
- xs:unique — Definition of a uniqueness constraint.
- xs:whiteSpace — Facet to define whitespace behavior.
-
16. Datatype Reference Guide
- xs:anyURI — URI (Uniform Resource Identifier).
- xs:base64Binary — Binary content coded as “base64”.
- xs:boolean — Boolean (true or false).
- xs:byte — Signed value of 8 bits.
- xs:date — Gregorian calendar date.
- xs:dateTime — Instant of time (Gregorian calendar).
- xs:decimal — Decimal numbers.
- xs:double — IEEE 64 bit floating point.
- xs:duration — Time durations.
- xs:ENTITIES — Whitespace separated list of unparsed entity references.
- xs:ENTITY — Reference to an unparsed entity.
- xs:float — IEEE 32 bit floating point.
- xs:gDay — Recurring period of time: monthly day.
- xs:gMonth — Recurring period of time: yearly month.
- xs:gMonthDay — Recurring period of time: yearly day.
- xs:gYear — Period of one year.
- xs:gYearMonth — Period of one month.
- xs:hexBinary — Binary contents coded in hexadecimal.
- xs:ID — Definition of unique identifiers.
- xs:IDREF — Definition of references to unique identifiers.
- xs:IDREFS — Definition of lists of references to unique identifiers.
- xs:int — 32 bit signed integers.
- xs:integer — Signed integers of arbitrary length.
- xs:language — RFC 1766 language codes.
- xs:long — 64 bit signed integers.
- xs:Name — XML 1.O names.
- xs:NCName — Unqualified names.
- xs:negativeInteger — Strictly negative integers of arbitrary length.
- xs:NMTOKEN — XML 1.0 name token (NMTOKEN).
- xs:NMTOKENS — List of XML 1.0 name token (NMTOKEN).
- xs:nonNegativeInteger — Integers of arbitrary length positive or equal to zero.
- xs:nonPositiveInteger — Integers of arbitrary length negative or equal to zero.
- xs:normalizedString — Whitespace-replaced strings.
- xs:NOTATION — Emulation of the XML 1.0 feature.
- xs:positiveInteger — Strictly positive integers of arbitrary length.
- xs:QName — Namespaces in XML qualified names.
- xs:short — 32 bit signed integers.
- xs:string — Any string.
- xs:time — Point in time recurring each day.
- xs:token — Whitespace-replaced and collapsed strings.
- xs:unsignedByte — Unsigned value of 8 bits.
- xs:unsignedInt — Unsigned integer of 32 bits.
- xs:unsignedLong — Unsigned integer of 64 bits.
- xs:unsignedShort — Unsigned integer of 16 bits.
- A. XML Schema Languages
- B. Work in Progress
- Glossary
- Index
- About the Author
- Colophon
- Copyright
Product information
- Title: XML Schema
- Author(s):
- Release date: June 2002
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596002527
You might also like
book
XML in a Nutshell, 3rd Edition
If you're a developer working with XML, you know there's a lot to know about XML, …
book
Beginning XML, 5th Edition
A complete update covering the many advances to the XML language The XML language has become …
book
Java XML and JSON: Document Processing for Java SE
Use this guide to master the XML metalanguage and JSON data format along with significant Java …
book
Learning XML, 2nd Edition
This second edition of the bestselling Learning XML provides web developers with a concise but grounded …