Thông tin tài liệu
www.it-ebooks.info
Beginning XML
4th Edition
David Hunter,
Jeff Rafter,
Joe Fawcett,
Eric van der Vlist,
Danny Ayers,
Jon Duckett,
Andrew Watt, and
Linda McKinnon
01_114872 ffirs.qxp 4/16/07 6:36 PM Page iii
www.it-ebooks.info
Beginning XML
4th Edition
01_114872 ffirs.qxp 4/16/07 6:36 PM Page i
www.it-ebooks.info
01_114872 ffirs.qxp 4/16/07 6:36 PM Page ii
www.it-ebooks.info
Beginning XML
4th Edition
David Hunter,
Jeff Rafter,
Joe Fawcett,
Eric van der Vlist,
Danny Ayers,
Jon Duckett,
Andrew Watt, and
Linda McKinnon
01_114872 ffirs.qxp 4/16/07 6:36 PM Page iii
www.it-ebooks.info
Beginning XML, 4
th
Edition
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2007 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-11487-2
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
Library of Congress Cataloging-in-Publication Data:
Beginning XML / David Hunter [et al.]. 4th ed.
p. cm.
ISBN 978-0-470-11487-2 (paper/website)
1. XML (Document markup language) I. Hunter, David, 1974 May 7-
QA76.76.H94B439 2007
006.7’4 dc22
2007006580
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 of
the 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, MA
01923, (978) 750-8400, fax (978) 646-8600. 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-4355, or
online at www.wiley.com/go/permissions.
LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRE-
SENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF
THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WAR-
RANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY
SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE
SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS
NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFES-
SIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE
SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HERE-
FROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION
AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE
PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOM-
MENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN
THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND
WHEN IT IS READ.
For general information on our other products and services please contact our Customer Care Department within the
United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are trade-
marks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, 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.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available
in electronic books.
01_114872 ffirs.qxp 4/16/07 6:36 PM Page iv
www.it-ebooks.info
I would like to thank God, for continuing to give me opportunities to do
what I love; my church family, for giving me more support than I deserve;
and Andrea, for giving me more support than anyone deserves.
I would also like to thank the editors, for their constant help.
Their dedication to the quality of this book was a major factor in its success.
—David
To Ali and Jude, for their loving patience.
—Jeff
To my two brothers, Peter and Stephen, who have both helped me in my life
and career in their own ways, many thanks.
—Joe
To my wife, Catherine, and children, Deborah, David, Samuel, and Sarah,
for their patience and support while I am busy writing books.
—Eric
To my late grandmother, Mona Cartledge, who once gave me a
Commodore Pet.
—Danny
01_114872 ffirs.qxp 4/16/07 6:36 PM Page v
www.it-ebooks.info
About the Authors
David Hunter is a Senior Technical Consultant for CGI, a full-service IT and business process services
partner. Providing technical leadership and guidance for solving his clients’ business problems, he is a
jack-of-all-trades and master of some. With a career that has included design, development, support,
training, writing, and other roles, he has had extensive experience building scalable, reliable, enterprise-
class applications. David loves to peek under the hood at any new technology that comes his way, and
when one catches his fancy, he really gets his hands dirty. He loves nothing more than sharing these
technologies with others.
Jeff Rafter is an independent consultant based in Redlands, California. His focus is on emerging tech-
nology and web standards, including XML and validation. He currently works with Baobab Health
Partnership with a focus on improving world health.
Joe Fawcett (
http://joe.fawcett.name) started programming in the 1970s and worked briefly in IT
when leaving full-time education. He then pursued a more checkered career before returning to software
development in 1994. In 2003 he was awarded the title of Microsoft Most Valuable Professional in XML
for community contributions and technical expertise; he has subsequently been re-awarded every year
since. Joe currently works in London and is head of software development for FTC Kaplan Ltd., a lead-
ing international provider of accountancy and business training.
Eric van der Vlist is an independent consultant and trainer. His domains of expertise include web devel-
opment and XML technologies. He is the creator and main editor of XMLfr.org, the main site dedicated
to XML technologies in French, the lead author of Professional Web 2.0 Programming, the author of the
O’Reilly animal books XML Schema and RELAX NG and a member or the ISO DSDL (
http://dsdl.org)
working group focused on XML schema languages. He is based in Paris and can be reached at
vdv@dyomedea.com, or meet him at one of the many conferences where he presents his projects.
Danny Ayers is a freelance developer and consultant specializing in cutting-edge web technologies.
His blog (
http://dannyayers.com) tends to feature material relating to the Semantic Web and/or
cat photos.
Linda McKinnon has more than 10 years of experience as a successful trainer and network engineer,
assisting both private and public enterprises in network architecture design, implementation, system
administration, and RFP procurement. She is a renowned mentor and has published numerous Linux
study guides for Wiley Press and Gearhead Press.
01_114872 ffirs.qxp 4/16/07 6:36 PM Page vi
www.it-ebooks.info
Credits
Senior Acquisitions Editor
Jim Minatel
Development Editors
Sara Shlaer
Lisa Thibault
Technical Editor
Phred Menyhert
Production Editor
William A. Barton
Copy Editor
Luann Rouff
Editorial Manager
Mary Beth Wakefield
Production Manager
Tim Tate
Vice President and Executive Group Publisher
Richard Swadley
Vice President and Executive Publisher
Joseph B. Wikert
Graphics and Production Specialists
Brooke Graczyk
Denny Hager
Joyce Haughey
Jennifer Mayberry
Barbara Moore
Alicia B. South
Quality Control Technician
John Greenough
Project Coordinator
Lynsey Osborn
Media Development Specialists
Angie Denny
Kit Malone
Kate Jenkins
Steve Kudirkan
Proofreading
Aptara
Indexing
Broccoli Information Management
Anniversary Logo Design
Richard Pacifico
01_114872 ffirs.qxp 4/16/07 6:36 PM Page vii
www.it-ebooks.info
01_114872 ffirs.qxp 4/16/07 6:36 PM Page viii
www.it-ebooks.info
[...]... 10: XML and Databases 375 The Need for Efficient XML Data Stores The Increasing Amount of XML Comparing XML- Based Data and Relational Data Approaches to Storing XML 375 376 377 378 Storing XML on File Systems Using XML With Conventional Databases Native XML Databases Using Native XML Databases 378 379 381 382 Obtaining and Installing eXist Interacting with eXist 382 384 XML in Commercial RDBMSs 395 XML. .. Questions 142 143 143 143 143 144 Question 1 Question 2 Question 3 144 144 144 Chapter 5: XML Schemas 145 Benefits of XML Schemas 146 XML XML XML XML Schemas Use XML Syntax Schema Namespace Support Schema Data Types Schema Content Models Do We Still Need DTDs? XML Schemas 146 146 147 147 147 148 The XML Schema Document Running the Samples Declarations Declarations Declarations... Introduction 1 Chapter 1: What Is XML? 3 Of Data, Files, and Text 3 Binary Files Text Files A Brief History of Markup 4 5 6 So What Is XML? 7 What Does XML Buy Us? HTML and XML: Apples and Red Delicious Apples Hierarchies of Information What’s a Document Type? No, Really — What’s a Document Type? Origin of the XML Standards What Is the World Wide Web Consortium? Components of XML Where XML Can Be Used, and What... Inheritance Attaching the Stylesheet to an XML Document Selectors Using CSS for Layout of XML Documents Understanding the Box Model Positioning in CSS 694 695 699 700 701 702 706 Laying Out Tabular Data Links in XML Documents 719 721 XLink Support in Firefox Forcing Links Using the XHTML Namespace 721 725 Images in XML Documents Using CSS to Add Content to Documents Attribute Content 725 726 729 Attribute... XML Document Obect Model Online Appendix E: XML Schema Element and Attribute Reference Online Appendix F: XML Schema Datatypes Reference Online Appendix G: SAX 2.0.2 Reference Online Index 971 xxv www.it-ebooks.info www.it-ebooks.info Introduction Welcome to Beginning XML, Fourth Edition, the book I wish I’d had when I was first learning the language! When we wrote the first edition of this book, XML. .. different XML vocabularies This Part introduces you to DTDs, XML Schemas, and RELAX NG: three languages that define custom XML vocabularies We also show you how to utilize these definitions to validate your XML documents xxix www.it-ebooks.info Introduction Chapter 4: Document Type Definitions You can specify how an XML document should be structured, and even provide default values, using Document Type... formats is what makes XML so powerful Chapter 7: XPath The XPath language is used to locate sections and data in the XML document, and it’s important in many other XML technologies Chapter 8: XSLT XML can be transformed into other XML documents, HTML, and other formats using XSLT stylesheets, which are introduced in this chapter Part IV: Databases Creating and processing XML documents is good, but... Service Support 395 426 XML in Open Source RDBMS 426 Installing MySQL Adding Information in MySQL Querying MySQL Updating XML in MySQL Usability of XML in MySQL Client-Side XML Support 426 427 430 435 436 437 Choosing a Database to Store XML Looking Ahead Summary Exercise Questions 438 438 438 438 Question 1 Question 2 Question 3 439 439 439 Part V: Programming 441 Chapter 11: The XML Document Object Model... comfortable with XML and have seen it in action, we unleash the programmer within and look at an XML- based programming language that you can use to transform XML documents from one format to another ❑ Eventually, you will need to store and retrieve XML information from databases At this point, you will learn not only the state of the art for XML and databases, but also how to query XML information using... want to store those documents This section describes strategies for storing and retrieving XML documents and document fragments from different databases Chapter 9: XQuery, the XML Query Language Very often, you will need to retrieve information from within a database XQuery, which is built on XPath and XPath2, enables you to do this in an elegant way Chapter 10: XML and Databases XML is perfect for . 144
Chapter 5: XML Schemas 145
Benefits of XML Schemas 146
XML Schemas Use XML Syntax 146
XML Schema Namespace Support 146
XML Schema Data Types 147
XML Schema. Cataloging-in-Publication Data:
Beginning XML / David Hunter [et al.]. 4th ed.
p. cm.
ISBN 978-0-470-11487-2 (paper/website)
1. XML (Document markup language)
Ngày đăng: 07/03/2014, 18:20
Xem thêm: Beginning XML 4th Edition doc