Definitive XML Schema
Second Edition
Priscilla Walmsley
![Definitive XML Schema - image 1](/uploads/posts/book/192811/graphics/pub.jpg)
Upper Saddle River, NJ Boston Indianapolis San Francisco
New York Toronto Montreal London Munich Paris Madrid
Cape Town Sydney Tokyo Singapore Mexico City
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals.
The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein.
Titles in this series are produced using XML, SGML, and/or XSL. XSL-FO documents are rendered into PDF by the XEP Rendering Engine from RenderX: www.renderx.com.
The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact:
U.S. Corporate and Government Sales
(800) 3823419
For sales outside the United States, please contact:
International Sales
Visit us on the Web: informit.com/ph
Library of Congress Cataloging-in-Publication Data is on file
Copyright 2013 Pearson Education, Inc.
All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. To obtain permission to use material from this work, please submit a written request to Pearson Education, Inc., Permissions Department, One Lake Street, Upper Saddle River, New Jersey 07458, or you may fax your request to (201) 2363290.
ISBN-13: 978-0-132-88672-7
ISBN-10: 0-132-88672-3
Text printed in the United States on recycled paper at Edwards Brothers Malloy in Ann Arbor, MI.
First printing: September 2012
Editor-in-Chief: Mark L. Taub
Managing Editor: Kristy Hart
Book Packager: Alina Kirsanova
Cover Designer: Alan Clements
![Definitive XML Schema - image 2](/uploads/posts/book/192811/graphics/iifig01.jpg)
The Charles F. Goldfarb Definitive XML Series
Priscilla Walmsley
Definitive XML Schema Second Edition
Charles F. Goldfarb and Paul Prescod
Charles F. Goldfarbs XML Handbook Fifth Edition
Rick Jelliffe
The XML and SGML Cookbook: Recipes for Structured Information
Charles F. Goldfarb, Steve Pepper, and Chet Ensign
SGML Buyers Guide: Choosing the Right XML and SGML Products and Services
G. Ken Holman
Definitive XSL-FO
Definitive XSLT and XPath
Bob DuCharme
XML: The Annotated Specification
SGML CD
Truly Donovan
Industrial-Strength SGML: An Introduction to Enterprise Publishing
Lars Marius Garshol
Definitive XML Application Development
JP Morgenthal with Bill la Forge
Enterprise Application Integration with XML and Java
Michael Leventhal, David Lewis, and Matthew Fuchs
Designing XML Internet Applications
Adam Hocek and David Cuddihy
Definitive VoiceXML
Dmitry Kirsanov
XSLT 2.0 Web Development
Yuri Rubinsky and Murray Maloney
SGML on the Web: Small Steps Beyond HTML
David Megginson
Structuring XML Documents
Sean McGrath
XML Processing with Python
XML by Example: Building E-commerce Applications
ParseMe.1st: SGML for Software Developers
Chet Ensign
$GML: The Billion Dollar Secret
Ron Turner, Tim Douglass, and Audrey Turner
ReadMe.1st: SGML for Writers and Editors
Charles F. Goldfarb and Priscilla Walmsley
XML in Office 2003: Information Sharing with Desktop XML
Michael Floyd
Building Web Sites with XML
Fredrick Thomas Martin
TOP SECRET Intranet: How U.S. Intelligence Built IntelinkThe Worlds Largest, Most Secure Network
J. Craig Cleaveland
Program Generators with XML and Java
About the Series Author
Charles F. Goldfarb is the father of XML technology. He invented SGML, the Standard Generalized Markup Language on which both XML and HTML are based. You can find him on the Web at: www.xmlbooks.com.
About the Series Logo
The rebus is an ancient literary tradition, dating from 16th century Picardy, and is especially appropriate to a series involving fine distinctions between markup and text, metadata and data. The logo is a rebus incorporating the series name within a stylized XML comment declaration.
To Doug, my SH
Foreword
classic(adjective)
judged over a period of time to be important and of the highest quality:
a classic novel
a classic car
Neither this definition, nor any of the leading dictionary definitions, has a usage example anything like:
a classic work on high-tech software
After all, it is a rare book on software that even survives long enough to be judged over a period of time.
Nevertheless, Definitive XML Schema satisfies every definition of classic. It is one of the elite few software books that have been in print continuously for over ten years, and an essential trustworthy guide for tens of thousands of readers.
This Second Edition continues to be an essential and trustworthy classic:
Essential because in the last ten years XML has become the accepted standard for data interchange, and XML Schema 1.0 is largely responsible. Now version 1.1 has extended the ability to specify and validate document data, to a degree previously possible only for databases. These updates are covered in this book by extensive revisionsthe most significant 250 of which are flagged in the text and table of contents. Hundreds more unflagged revisions reflect W3C corrections of XML Schema errata, and ten years of evolving best practices.
Trustworthy because it is both authoritative and accurate.
The author(ity), Priscilla Walmsley, is a noted consultant who has been using XML Schema ever since she helped develop it as a member of the W3C XML Schema Group. She personally devised many of the current best practices described in this book. Priscilla is the Editor of the W3C XML Schema Primer, Second Edition.
Accuracy was preserved by using the same XML-based production system that was used in 2002, operated by the same team of XML experts who read and thoroughly understood the book. Priscillas original XML source (in which she had personally tagged the version 1.1 revisions) was used throughout production. Dmitry Kirsanov copy-edited and proofed it, while Alina Kirsanova prepared the index, coded the XSL transformations, and generated the camera-ready PDFs.