This document is created with the unregistered version of CHM2PDF Pilot < Free Open Study > Beginning XML, 2nd Edition: XML Schemas, SOAP, XSLT, DOM, and SAX 2.0 by David Hunter, Kurt ISBN:0764543946 Cagle, Chris Dix et al Wrox Press © 2003 (784 pages) This book teaches you all you need to know about XML what it is, how it works, what technologies surround it, and how it can best be used in a variety of situations, from simple data transfer to using XML in your web pages Table of Contents Beginning XML, 2nd Edition—XML Schemas, SOAP,XSLT,DOM, and SAX 2.0 Introduction Ch apt - What is XML? er Ch apt - Well-Formed XML er Ch apt - XML Namespaces er Ch apt - XSLT er Ch apt - Document Type Definitions er Ch apt - XML Schemas er Ch apt - Advanced XML Schemas er This document is created with the unregistered version of CHM2PDF Pilot Ch apt er Ch apt er Ch apt er 10 Ch apt er 11 Ch apt er 12 Ch apt er 13 Ca se Stu dy Ca se Stu dy Ap pe ndi x A Ap pe ndi x B Ap pe ndi x C - The Document Object Model (DOM) - The Simple API for XML (SAX) - SOAP - Displaying XML - XML and Databases - Linking and Querying XML - Using XSLT to Build Interactive Web Applications - XML Web Services - The XML Document Object Model - XPath Reference - XSLT Reference This document is created with the unregistered version of CHM2PDF Pilot Ap pe ndi x D Ap pe ndi xE Ap pe ndi xF Ap pe ndi x G Index Schema Element and Attribute Reference Schema Datatypes Reference SAX 2.0: The Simple API for XML Useful Web Resources < Free Open Study > This document is created with the unregistered version of CHM2PDF Pilot < Free Open Study > Back Cover Extensible Markup Language (XML) is a rapidly maturing technology with powerful real-world applications, particularly for the management, display, and transport of data Together with its many related technologies, it has become the standard for data and document delivery on the Web This book teaches you all you need to know about XML—what it is, how it works, what technologies surround it, and how it can best be used in a variety of situations, from simple data transfer to using XML in your web pages It builds on the strengths of the first edition, and provides new material to reflect the changes in the XML landscape—notably SOAP and Web Services, and the publication of the XML Schemas Recommendation by the W3C Who is this book for? Beginning XML, 2nd Edition is for any developer who is interested in learning to use XML in web, e-commerce, or data storage applications Some knowledge of mark up, scripting, and/or object oriented programming languages is advantageous, but no essential, as the basis of these techniques is explained as required What does this book cover? XML syntax and writing well-formed XML Using XML Namespaces Transforming XML into other formats with XSLT XPath and XPointer for locating specific XML data XML validation using DTDs and XML Schemas Manipulating XML documents with the DOM and SAX 2.0 SOAP and Web Services Displaying XML using CSS and XSL Incorporating XML into traditional databases and n-tier architectures XLink for linking XML and non-XML resources < Free Open Study > This document is created with the unregistered version of CHM2PDF Pilot < Free Open Study > Beginning XML, 2nd Edition-XML Schemas, SOAP,XSLT,DOM, and SAX 2.0 Kurt Cagle Chris Dix David Hunter Roger Kovack Jon Pinnock Jeff Rafter Published by Wiley Publishing, Inc 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2003 by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada Library of Congress Card Number: 2003107073 ISBN: 0-7645-4394-6 Manufactured in the United States of America 10 1B/RQ/QW/QT/IN No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 ofthe 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA01923, (978) 750-8400, fax (978) 646-8700 Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4447, E-Mail: permcoordinator@wiley.com LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: WHILE THE PUBLISHER AND AUTHOR HAVE USED THEIR BEST EFFORTS IN PREPARING THIS BOOK, THEYMAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS BOOK AND SPECIFICALLY DISCLAIM ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR APARTICULAR PURPOSE NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES REPRESENTATIVES OR WRITTEN SALES MATERIALS THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR YOUR SITUATION YOU SHOULD CONSULT WITH A PROFESSIONAL WHERE APPROPRIATE NEITHER THE This document is created with the unregistered version of CHM2PDF Pilot PUBLISHER NOR AUTHOR SHALLBE LIABLE FOR ANYLOSS OF PROFIT OR ANYOTHER COMMERCIALDAMAGES, INCLUDING BUT NOT LIMITED TO SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR OTHER DAMAGES For general information on our other products and services or to obtain technical support, please contact our Customer Care Department within the U.S at (800) 762-2974, outside the U.S at (317) 572-3993 or fax (317) 572-4002 Wiley also publishes its books in a variety of electronic formats Some content that appears in print may not be available in electronic books Trademarks: Wiley, the Wiley Publishing logo, Wrox, the Wrox logo, the Wrox Programmer to Programmer logo and related trade dress are trademarks or registered trademarks of Wiley in the United States and other countries, and may not be used without written permission All other trademarks are the property of their respective owners Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book Trademark Acknowledgements Wrox has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals However, Wrox cannot guarantee the accuracy of this information Credits Authors Kurt Cagle Chris Dix David Hunter Roger Kovack Jonathon Pinnock Jeff Rafter Technical Reviewers Steve Baker David Beauchemin Martin Beaulieu Natalia Bortniker Oli Gauti Gudmundsson Paul Houle Graham Innocent Sachin Kanna Sing Li Steven Livingstone Nikola Ozu Jeff Rafter Gareth Reakes Eddie Robertsson David Schultz Ian Stokes-Rees Category Managers Simon Cox Dave Galloway Technical Architect Peter Morgan This document is created with the unregistered version of CHM2PDF Pilot Technical Editors Sarah Larder Simon Mackie Indexers' Michael Brinkman Fiona Murray Production Manager Liz Toy Production Project Co-ordinator Mark Burdett Author Agent Marsha Collins Production Assistant Abbie Forletta Project Manager Vicky Idiens Cover Dawn Chellingworth Proof Reader Keith Westmoreland About the Authors Kurt Cagle Kurt Cagle is a writer and developer specializing in XML and Internet related issues He has written eight books and more than one hundred articles on topics ranging from Visual Basic programming to the impact of the Internet on society, and has consulted for such companies as Microsoft, Nordstrom, AT&T and others He also helped launch Fawcette's XML Magazine and has been the DevX DHTML and XML Pro for nearly two years Kurt Cagle contributed Chapter 11 to this book Chris Dix Chris Dix has been developing software for fun since he was 10 years old, and for a living for the past years He is one of the authors of Professional XML Web Services, and he frequently writes and speaks on the topic of XML and Web Services Chris is Lead Developer for NavTraK, Inc., a leader in automatic vehicle location systems located in Salisbury, Maryland, where he develops Web Services and system architecture He can be reached at cdix@navtrak.net I would like to thank my wife Jennifer and my wonderful sons Alexander and Calvin for their love and support I would also like to thank the people at Wrox for this opportunity, and for their technical expertise in helping make this possible Chris Dix contributed Case Study to this book This document is created with the unregistered version of CHM2PDF Pilot David Hunter David Hunter is a Senior Architect for MobileQ, a leading mobile software solutions developer, and the first company to ship an XML-based mobility server David has extensive experience building scalable applications, and provides training on XML He also works closely with the team that develops MobileQ's flagship product, XMLEdge, which delivers the ideal mobile user experience on a diverse number of mobile devices First of all, I would like to thank God for the incredible opportunities he has given me to something I love, and even write books about it I pray that the glory will go to him I would also like to thank Wrox's editors; if this book is helpful, easy to read, and easy to understand, it's because the editors made it that way And finally, I'd like to thank the person who gave me the most support, but probably doesn't even realize it Thank you, Andrea, for helping me through this." David Hunter contributed Chapters 1,2,3,4,8,10, 12, and 13 to this book Roger Kovack Roger Kovack has more than 25 years of software development experience, started by programming medical research applications in Fortran on DEC machines at the University of California More recently he has consulted to Wells Fargo and Bank of America, developing departmental information systems on desktop and client/server platforms Bitten by Java and the web bug in the mid '90s he developed web applications for Commerce One, a major B2B software vendor; and for LookSmart.com, one of the best known and still operating web portals He was instrumental in bringing Java into those organizations to replace ASP and C++ Roger can be contacted on http://www.xslroot.com "My deep thanks to my wife, Julie, for the encouragement and support for writing this chapter I'm also endlessly grateful for the help and attention the editorial team at Wrox Press provided Their concern for quality content can't be overstated Words can't express my sorrow and compassion for the innocent victims and their families whose lives were shattered by the terrorist attacks on New York and Washington DC on September 11, 2001 The personal, permanent wound that has caused makes me plead for world peace." Roger Kovack contributed Case Study to this book Jon Pinnock Jonathan Pinnock started programming in Pal III assembler on his school's PDP 8/e, with a massive 4K of memory, back in the days before Moore's Law reached the statute books These days he spends most of his time developing and extending the increasingly successful PlatformOne product set that his company, JPA, markets to the financial services community JPA's home page is at: www.jpassoc.co.uk "My heartfelt thanks go to Gail, who first suggested getting into writing, and now suffers the consequences on a fairly regular basis, and to Mark and Rachel, who just suffer the consequences." Jon Pinnock contributed Chapter to this book Jeff Rafter Jeff Rafter currently resides in Iowa City, where he is studying Creative Writing at the University of Iowa For the past two years, he has worked with Standfacts Credit Services, a Los Angeles based company, developing XML interfaces for use in the mortgage industry He also leads the XML development for Defined Systems, a web hosting company founded with his long time friend Dan English In his free time, Jeff composes sonnets, plays chess in parks, skateboards, and reminisces about the Commodore64 video game industry of the late 1980s This document is created with the unregistered version of CHM2PDF Pilot "I thank God for his love and grace in all things I would also like to thank my beautiful wife Ali, who is the embodiment of that love in countless ways She graciously encouraged me to pursue my dreams at any cost Thanks also to Mike McKay who was first a servant and then a friend as I worked through the writing process Finally, I would like to thank Vicky, Peter, Sarah, Simon, Victoria, Marsha and everyone at Wrox for the opportunity and support I would also like to express my gratitude to the invaluable reviewers." Jeff Rafter contributed Chapters 5, 6, and to this book < Free Open Study > This document is created with the unregistered version of CHM2PDF Pilot < Free Open Study > Introduction Welcome to Beginning XML, 2nd Edition, the book I wish I'd had when I was first learning the language! When we wrote the 1st Edition of this book, XML was a relatively new language, but was already gaining ground fast, and becoming more and more widely used in a vast range of applications By the time we started the 2nd Edition, XML had already proven itself to be more than a passing fad, and was in fact being used throughout the industry for an incredibly wide range of uses There are also quite a number of specifications surrounding XML, which either use XML or provide functionality in addition to the XML core specification, which aim to allow developers to some pretty powerful things So what is XML? It's a markup language, used to describe the structure of data in meaningful ways Anywhere that data is input/output, stored, or transmitted from one place to another, is a potential fit for XML's capabilities Perhaps the most well known applications are web related (especially with the latest developments in handheld web access?for which some of the technology is XML-based) But there are many other non-web based applications where XML is useful?for example as a replacement for (or to complement) traditional databases, or for the transfer of financial information between businesses This book aims to teach you all you need to know about XML?what it is, how it works, what technologies surround it, and how it can best be used in a variety of situations, from simple data transfer to using XML in your web pages It will answer the fundamental questions: What is XML? How I use XML? How does it work? What can I use it for, anyway? Who is this Book For? This book is for people who know that it would be a pretty good idea to learn the language, but aren't 100% sure why You've heard the hype, but haven't seen enough substance to figure out what XML is, and what it can You may already be somehow involved in web development, and probably even know the basics of HTML, although neither of these qualifications is absolutely necessary for this book What you don't need is knowledge of SGML (XML's predecessor), or even markup languages in general This book assumes that you're new to the concept of markup languages, and we have tried to structure it in a way that will make sense to the beginner, and yet quickly bring you to XML expert status The word "Beginning" in the title refers to the style of the book, rather than the reader's experience level There are two types of beginner for whom this book will be ideal: ... XLink for linking XML and non -XML resources < Free Open Study > This document is created with the unregistered version of CHM 2PDF Pilot < Free Open Study > Beginning XML, 2nd Edition -XML Schemas,... CHM 2PDF Pilot < Free Open Study > Introduction Welcome to Beginning XML, 2nd Edition, the book I wish I'd had when I was first learning the language! When we wrote the 1st Edition of this book, XML. .. The Simple API for XML (SAX) - SOAP - Displaying XML - XML and Databases - Linking and Querying XML - Using XSLT to Build Interactive Web Applications - XML Web Services - The XML Document Object