In order to leverage XML's power as a self-describing and extensible language, we need a way to define and describe the allowable content of any type of XML document. In the past, this has been achieved with DTDs, but these have in many ways fallen short of the requirements for working with data. XML Schemas were created to provide a more powerful and flexible mechanism for describing permissible document structures using XML syntax. They provide a set of built-in datatypes, which can mimic the object-oriented mechanisms of many languages, offer support for namespaces, and facilities for automated documentation.
Professional XML Schemas exhaustively details the W3C XML Schema language, and teaches the new syntax in an intuitive and logical way. From declaring elements and attributes, creating complex content models, and working with multiple namespaces, you'll move on to see how XML Schemas are used in real-world situations. A number of practical case studies will illustrate the design and creation of schemas in the diverse worlds of relational databases, document management, and e-commerce applications.
This book covers:
A complete guide to XML Schema Syntax
Using XML Schema built-in types, and deriving new types
Working with XML Schemas and namespaces
Creating identity and uniqueness constraints
Good XML Schema design, illustrated in a number of different areas
Working with XML Schemas and XSLT
Writing XML Schemas for working with SOAP
Integrating Schematron and XML Schemas
Professional XML Schemas is a detailed guide to the XML Schema language. Schemas define the allowable content of a class of XML documents. They form an alternative to the DTD (Document Type Definition), and provide more powerful features including the ability to define data types and structures. This book covers the official W3C Schema Recommendation, released in May 2001. It is a valuable title for developers, particularly since many XML books give only sketchy coverage of this key topic.
Starting with an overview of what Schemas are for, the authors go on to cover the built-in Schema datatypes and then show how to define complex types and content models. A chapter of example datatypes helps to bring this material into focus. Next comes a close look at how XML Namespaces are used in the Schema language, including three design models with intriguing names: Russian Doll, Salami Slice and Venetian Blind. There is a chapter on using Schemas defined in multiple documents, followed by a guide to Identity Constraints and Normalisation, which are important for database work. Further chapters tackle XSLT, system modelling, creating Schema for an existing database, and document management. A fascinating chapter looks at Schema-based programming, which implements an entire application in XML. The authors also take a quick look at non-W3C schemas, particularly one called Schematron, and there is an appendix of reference material.
Professional XML developers need to know about Schemas, and this is a thorough and informative tutorial. It is a complex subject, but the book is sensibly organised so that readers can easily master the basics before going on to the more demanding aspects. --Tim Anderson