HAPPY BOOKSGIVING
Use code BOOKSGIVING during checkout to save 40%-55% on books and eBooks. Shop now.
Register your product to gain access to bonus material or receive a coupon.
With the successful implementation of XML Schema, developers are learning how to increase productivity, improve software reliability, minimize development time, and decrease time to market. This in-depth reference is an all-in-one resource designed to help developers leverage the power and potential of XML schemas by offering a complete roadmap to their creation, design, and use.
This authoritative reference and tutorial is filled with practical insights and detailed examples. The book begins by providing a conceptual introduction to XML Schema. From there, coverage shifts to the W3C Schema Recommendation and how to apply schemas to specific business goals. The authors provide insight and instruction throughout on integrating XML schemas into existing technologies such as .NET, Java, Visual Basic, Oracle, and more. The book concludes with a complete case study designed to reinforce and illustrate material covered.
Additional topics include:
Whether designing a schema from scratch or integrating schemas into contemporary technologies, The XML Schema Complete Reference is the most complete and definitive sourcebook available for the XML Schema environment.
Enforcing Referential Integrity with XML Schema Identity Constraints
XML Schema Regular Expressions
Click below for Web Resources related to this title:
Author Web Site
Java and the Apache XML Project
MSXML and the Schema Object Model (SOM)
XML Schema: XPath and Xpointer
Click below for Sample Chapter(s) related to this title:
Sample
Chapter 4
Preface.
Acknowledgments.
I. XML SCHEMA OVERVIEW.
1. Introduction.Why XML?
Why XML Schemas?
What Is an XML Schema Document?
Benefits of an XML Schema.
Drawbacks of an XML Schema.
The World Wide Web Consortium (W3C) Recommendations.
The XML Recommendation.
The Namespace Recommendation.
The Infoset Recommendation.
The XPath Recommendation.
The Schema Recommendation.
Object-oriented Concepts.
Unifying Terminology.
Important Terminology Used in This Book.
Schema Values.
Parallel Concepts and Ignoring Differences.
Element Terminology.
Element Type Terminology.
Other Terminology to Expect in This Book.
Thematic Examples.
Thematic Example Quality.
Creating an XML Schema Document.
Editing an XML Schema Document.
Validating an XML Instance.
Typesetting Conventions.
Online Resources.
2. XML Processing.Basics.
Entity Managers.
Parsers and Lexical Analyzers.
Validators.
Parsing Events, Information Sets, and Applications.
XML Structure Before and After Parsing.
XML Documents.
The XML Information Set.
The DOM.
Schema Processing.
Processing an XML Schema Document.
What Does a Schema Processor Add? The PSVI.
3. XML Namespaces.Uniform Resource Names and Uniform Resource Locators.
Creating URIs.
Using RDDL with Namespace URLs.
Namespace Components.
Declaring Namespaces.
Qualified Names and QNames.
Qualified Names as Values.
Namespace Scoping.
XML Schema and Namespaces.
4. XPath and XPointer.XPath.
XPath Location Paths.
Predicates.
Node IDs.
Using XPath with Identity Constraints.
XPointer.
Location Sets.
Namespaces.
Subelement Sequences.
XPointer Extensions to XPath.
Using XPointer and XPath to Locate Schemas.
5. The Structure of Documents and Schemas.XML Documents.
The XML Information Set.
The Document Information Item Class.
The Element Information Item Class.
The Attribute Information Item Class.
The Character Information Item Class.
XML Information Set Summary.
Introduction to the PSVI.
Introduction to Schemas.
Schema Documents.
II. CREATING XML SCHEMA DOCUMENTS.
6. Overview of an XML Schema Document.The Enclosing Schema Element.
Namespaces.
The Default Namespace.
The Target Namespace.
Namespaces and the XML Instance.
Scope.
Global Components.
Local and Anonymous Components.
Annotating Elements.
Constraining Elements.
Simple Content.
Constraining Attributes.
Simple Attribute Values.
Named Attribute-use Groups.
Attribute Wildcards.
Simple Types.
Built-in Datatypes.
Deriving Simple Types by Restriction.
Constraining Facets.
Lists.
Unions.
Complex Types.
Simple Content.
Complex Content.
Deriving Complex Types by Extension.
Deriving Complex Types by Restriction.
Blocking Complex Types.
Model Groups.
The All Model Group.
The Choice Model Group.
The Sequence Model Group.
The Named Model Group.
Substitution Groups.
Instantiability.
Identity Constraint Definitions.
Notations.
Imports and Includes.
Locating XML Schemas and XML Schema Components.
Schema Element IDs.
7. Creating an XML Schema Document.A Simple XML Schema Document Example.
A Schema Element with Every Attribute.
Concepts and Observations.
Attributes of a Schema Element.
Content Options for a Schema Element.
The Annotation Element.
Attributes of an annotation Element.
Content Options for an Annotation Element.
The Appinfo Element.
Attributes of an Appinfo Element.
Content Options for an Appinfo Element.
The documentation Element.
Attributes of a Documentation Element.
Content Options for a Documentation Element.
The Include Element.
Attributes of an Include Element.
Content Options for an Include Element.
The Import Element.
Attributes of an Import Element.
Content Options for an Import Element.
The Notation Element.
Attributes of a Notation Element.
Content Options for a Notation Element.
The Redefine Element.
Attributes of a Redefine Element.
Content Options for a Redefine Element.
8. Element Types.An Example of a Trivial Element Type.
Concepts and Observations.
Global and Local Element Types.
Substitution Groups.
Blocking Substitution.
Element Type Instantiability.
Nillable Element Types.
Element Types and Namespaces.
The Element Element.
Attributes of an Element Element.
Content Options for an Element Element.
The any Element.
Attributes of an any Element.
Content Options for an AnyAttribute Element.
9. Attribute Types.An Example of an Attribute Type.
An Example of a Named Attribute-use Group.
An Example of AnyAttribute.
Concepts and Observations Regarding Attribute Types.
When to Use an Attribute Type.
Global and Local Attribute Types.
Namespaces and Attribute Types.
The Attribute Element.
Attributes of an Attribute Element.
Content Options for an Attribute Element.
The AttributeGroup Element.
Attributes of an AttributeGroup Element.
Content Options for an AttributeGroup Element.
The AnyAttribute Element.
Attributes of an AnyAttribute Element.
Content Options for an AnyAttribute Element.
10. Simple Types.An Example of a Simple Type Derived from the Built-In Token Datatype.
An Example of a Pattern-Constrained Simple Type.
An Example of a Simple Type Derived from a User-derived Simple Type.
Concepts and Observations.
Constraining Facets.
The Value Space.
The Lexical Space.
The Canonical Lexical Representation.
Non-Instantiable Simple Types.
Global, Local, and Anonymous Simple Types.
Blocking.
The SimpleType Element.
Attributes of a SimpleType Element.
Constraining Facets of a SimpleType Element.
The Restriction Element.
Attributes of a Restriction Element.
Content Options for a Restriction Element.
Constraining Facets of a Restriction Element.
The List Element.
Attributes of a List Element.
Content Options for a List Element.
Constraining Facets of a List Element.
The Union Element.
Attributes of a Union Element.
Content Options for a Union Element.
Constraining Facets of a Union Element.
11. Complex Types.An Example of a Complex Type Specifying Empty Content.
An Example of a Complex Type That Adds Attributes to a Simple Type.
An Example of a Complex Type Specifying Nested Element Types.
An Example of a Complex Type Specifying Mixed Content.
Concepts and Observations.
Explicitly Non-Instantiable Complex Types.
Implicitly Non-Instantiable Complex Types.
Adding Element Types or Attribute Types to a Derived Complex Type.
Removing Element Types or Attribute Types from a Derived Complex Type.
Prohibiting Extension or Restriction of a Complex Type.
Shorthand Notation of a Complex Type.
The ComplexType Element.
Attributes of a ComplexType Element.
Content Options for a ComplexType Element.
The SimpleContent Element.
Attributes of a SimpleContent Element.
Content Options for a SimpleContent Element.
The ComplexContent Element.
Attributes of a ComplexContent Element.
Content Options for a ComplexContent Element.
The Extension Element.
Attributes of an Extension Element.
Content Options for an Extension Element.
The Restriction Element.
Attributes of a Restriction Element.
Content Options for a Restriction Element.
The All Element.
Attributes of an All Element.
Content Options for an All Element.
The Choice Element.
Attributes of a Choice Element.
Content Options for a Choice Element.
The Sequence Element.
Attributes of a Sequence Element.
Content Options for a Sequence Element.
The Group Element.
Attributes of a Group Element.
Content Options for a Group Element.
12. Built-In Datatypes.Numeric Datatypes.
The Built-In decimal Datatype.
The Built-In Floating-Point Datatypes: Float and Double.
The Built-in Infinite Integer Datatypes: Integer, Positiveintegeer, Negativeinteger, Nonpositiveinteger, Annonnegativeinteger.
The Built-in Finite Integer Datatypes: Long, Int, Short, Byte, Unsignedlonng, Unsignedint, Unsignedshortand Unsignedbyte.
Date, Time, and Duration Datatypes.
The Built-In Time-Line-based Datatypes: Datetime, Date, gYearMontth, and gYear.
The Built-In Duration Datatype.
The Built-In Repeating Dates and Times Datatypes: Time, gMonthDaay, gDay, and gMonth.
String Datatypes.
The Built-In String Datatype.
Ordinary String-Derived Datatypes: Normalizedstring, Token, Languagge, NMTOKEN, NMTOKENS, Name, anNCName.
“Magic” String-Derived Datatypes: IID, IDREF, IDREFS, ENTITY, and ENTITIES.
Oddball Datatypes.
The Built-In QName Datatype.
The Built-In Boolean Datatype.
The Built-In Hexbinary and Base64binary Datatypes.
The Built-in AnyURI Datatype.
The Built-In Notation Datatype.
13. Identity Constraints.Identity Constraint Example.
Concepts and Observations.
Identity Constraint Terminology.
Selectors and Fields.
Limited XPath Support.
Value Equality.
Enforcing Uniqueness.
Enforcing Referential Integrity.
The Unique Element.
The Attributes of a Unique Element.
Content Options for a Unique Element.
The Key Element.
The Attributes of a Key Element.
Content Options for a Key Element.
The Keyref Element.
The Attributes of a Keyref Element.
Content Options for a Keyref Element.
The Selector Element.
The Attributes of a Selector Element.
Content Options for a Selector Element.
The Field Element.
The Attributes of a Field Element.
Content Options for a Field Element.
14. Regular Expressions.Concepts and Observations.
Unicode Regular Expression Guidelines.
The Latin Character Set.
Perl Regular Expressions.
XML Schemas.
Regular Expression Syntax.
Metacharacters.
Concatenation.
Alternatives.
Grouping.
Individual Characters.
Cardinality Quantifiers.
Character Classes Expressions.
Precedence.
Constraining Simple Content.
The Pattern Constraining Facet.
Multiple Pattern Constraining Facets (or).
Constraining Derived Types (and).
III. VALIDATION.
15. XML Schema Component Detail.Schemas: The Basic Idea.
Names.
Annotations.
Schema (Schema Schema Component).
Attribute Types.
Attribute Type (Attribute Declaration Schema Component).
Simple Type (Simple Type Definition Schema Component).
Constraining Facets.
Element Types.
Element Type (Element Declaration Schema Component).
Complex Type (Complex Type Definition Schema Component).
Attribute Set Models.
Content Models.
Simple Type (Simple Type Definition Schema Component) Reprise.
Reusability.
Annotation (Annotation Schema Component).
Notation (Notation Declaration Schema Component).
16. PSVI Detail.Schema Validation and Schema Processing.
Kinds of Validation.
The Results of Validation.
The PSVI.
The Basic Infoset.
PSVI-Added Properties.
PSVI-Added Information Items.
The New PSVI Information Items.
17. Java and the Apache XML Project.Apache Background.
Java Xerces on Your Computer.
Downloading Java Xerces 2 Parser.
Exploring the Xerces Package.
Running the Samples.
“Hello Apache”.
Your First Parser.
Parsing “Hello Apache”.
Critical Xerces Packages.
Xerces Java DOM In-Depth.
The Document Interface.
Creating DOM Documents.
The Element Interface.
The Node Interface.
An Advanced DOM Example.
DOM Helpers and DOM Level 3.
Java Xerces SAX In-Depth.
The ContentHandler Interface.
18. MSXML and the Schema Object Model (SOM).Introducing MSXML.
Concepts and Observations.
…MS Stands for Microsoft.
Proprietary Versus Standard.
XML Schema Examples.
MSXML Fundamentals.
Using MSXML from Visual Basic.
Using the DOM.
Using SAX2.
Schema Object Model (SOM).
SOM Fundamentals.
The ISchemaItem Interface.
The ISchema Interface.
DOM Versus SOM.
Creating XML Schemas.
Validation.
XML Document Samples.
Validation by Using the DOM.
Validation by Using SAX2.
Example: XML Schema Tree.
IV. RESULT-ORIENTED SCHEMAS.
19. Object-Oriented Schemas.Concepts and Observations.
Fundamentals of Object-Oriented Development.
Use of Languages.
Object-Oriented Concepts.
Encapsulation.
Inheritance.
Polymorphism.
XML Schemas and Objects.
The Good.
The Bad.
The Answer.
Mapping XML Schemas to Object-Oriented Languages.
Complex Types.
Element Types.
Attributes.
Schemas.
Simple Types.
Annotation.
Putting It Together.
Sample Schema: Party.xsd.
Design Patterns.
Builder Pattern and XML Schemas.
Language Examples.
Visual Basic.
C++.
C# and the .NET Framework.
20. Document-Oriented Schemas.Why Use XML for Documents?
Creating a Schema for a Set of Documents: Document Analysis.
Scenario: A Document Analysis.
Structures to Look For.
More Detail.
Implementing Document Processing.
Help for the Author.
Help for the Editor.
Automating Production.
21. Application-Oriented Schemas.XML Applications.
Fundamentals of XML Applications.
XML Input and Output.
Transport Protocol.
Business Logic.
Role of XML Schemas.
Validation of Data.
Describing Arguments.
Describing Applications.
Application Structure.
Sovereign.
Request-response.
Routing.
Transporting XML.
Transport Protocols.
HTTP.
XML and HTTP.
Describing Applications.
Using XML Schemas. 0672323745T09112002
The authoring and editorial teams for this book have worked hard to bring you the cleanest, clearest, and most complete XML schema reference source on the market. Endless sweat, research hours, code testing, tech and definition reviews and counter explanations, e-mail queries, dialogue, and debates passed before this book came to fruition. Earnest efforts, stress-filled moments, and writing deadlines have finally gotten us to press time. Here is what this book means to us.
The HistoryThere are always new and hot technologies to write about (C++, Java, SQL, .NET, XML schema, and much more). There are qualified writers eager to write a clear and concise bestseller for your bookshelf. There are millions of software developers eager to learn. There are more than a few publishers to choose from. Ultimately there are several technical books on the market within months of any new product, platform, service, tool, or language's release that seeks to describe, explain, clarify, and elaborate on a given technology's importance, utility, and implementation. However, there are very few really good books on the "why and when" that will actually teach developers emerging technologies. In fact, the hardest types of books to write discuss emerging technologies, because there really aren't many good examples. Furthermore, even the "experts" frequently disagree on what is "right."
We spent many months--full time--writing this book. Collectively, we have something like 80 years of experience. Some of us are on the W3C Schema Working Group. We believe that this combined experience, as well as the determination writing this book, results in one of the few "really good books" previously mentioned. It takes the right combination of technology, authors, publishers, and readers to pull off a book.
The BookThere are several, and probably soon to be lots, of books on the market that pertain to XML schemas. Despite this influx, we strongly believe that this book provides details few, if any, other books provide. Specifically, the overarching goal driving this book is to provide detailed examples of every XML schema component. In order to detail each component, this book contains an example of the corresponding schema document element, and all of the associated attributes. Many of the books on the market today provide surface details about schema components. However, this book provides detailed scenarios. Not only are there many pages and examples of each schema element, there is at least one example of every single attribute of every single XML schema document element. Having accomplished that colossal task, we added example after example integrating with many languages and technologies on many platforms. After all, what good is an XML schema by itself?
The Web SiteThe http://www.XMLSchemaReference.com Web site corresponds directly to this book. The sole purpose of this Web site is to provide an online reference for developers writing XML schemas. Nominally, the Web site provides a place to download all of the files created while writing this book. These files include not only the XML schemas and the source code in various languages, but also all of the test cases for even the one-line code snippets: all of the code in this book is tested!
The Web site is much more extensive than just a collection of files, however. In addition to the traditionally available downloads, http://www.XMLSchemaReference.com has lots simple online examples of every schema document element. There are tables for each element that indicate what attributes are possible, as well as a brief description. Although this Web site is not a tutorial, it is a fantastic quick reference for those who already understand schemas in general, but might forget the specific syntax. It is our hope that the Web site, like the book, becomes real reference material for lots of developers.
The ValueOur goal is to make it easy to create an XML schema--whether you need a tutorial to write your first schema document, or you just need a reference book to write your 5,000th. Having created a schema, this book also gives you the same levels of assistance to incorporate an XML schema into your application. This book provides as much support as you need, without ever getting in the way. Have fun working with XML schemas--we do!
We invite you now to take a tour through the world of XML schema components, beginning with the introduction provided for you in Chapter 1. We welcome your stories, additions, code samples, questions, feedback, and insights.
Cliff Binstock
Click below to download the Index file related to this title:
Index