XM lina nutshell third se

1.6K 44 0
XM lina nutshell third se

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > • • • • • • Table of Contents Index Reviews Reader Reviews Errata Academic XML in a Nutshell, 3rd Edition By Elliotte Rusty Harold, W Scott Means Publisher: O'Reilly Pub Date: September 2004 ISBN: 0-596-00764-7 Pages: 712 There's a lot to know about XML, and it s constantly evolving But you don't need to commit every syntax, API, or XSLT transformation to memory; you only need to know where to find it And if it's a detail that has to with XML or its companion standards, you'll find it clear, concise, useful, and well-organized in the updated third edition of XML in a Nutshell < Day Day Up > This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > • • • • • • Table of Contents Index Reviews Reader Reviews Errata Academic XML in a Nutshell, 3rd Edition By Elliotte Rusty Harold, W Scott Means Publisher: O'Reilly Pub Date: September 2004 ISBN: 0-596-00764-7 Pages: 712 Copyright Preface What This Book Covers What's New in the Third Edition Organization of the Book Conventions Used in This Book Request for Comments Acknowledgments Part I: XML Concepts Chapter Introducing XML Section 1.1 The Benefits of XML Section 1.2 What XML Is Not Section 1.3 Portable Data Section 1.4 How XML Works Section 1.5 The Evolution of XML Chapter XML Fundamentals Section 2.1 XML Documents and XML Files Section 2.2 Elements, Tags, and Character Data Section 2.3 Attributes Section 2.4 XML Names Section 2.5 References Section 2.6 CDATA Sections Section 2.7 Comments Section 2.8 Processing Instructions Section 2.9 The XML Declaration Section 2.10 Checking Documents for Well-Formedness Chapter Document Type Definitions (DTDs) This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Section 3.1 Validation Section 3.2 Element Declarations Section 3.3 Attribute Declarations Section 3.4 General Entity Declarations Section 3.5 External Parsed General Entities Section 3.6 External Unparsed Entities and Notations Section 3.7 Parameter Entities Section 3.8 Conditional Inclusion Section 3.9 Two DTD Examples Section 3.10 Locating Standard DTDs Chapter Namespaces Section 4.1 The Need for Namespaces Section 4.2 Namespace Syntax Section 4.3 How Parsers Handle Namespaces Section 4.4 Namespaces and DTDs Chapter Internationalization Section 5.1 Character-Set Metadata Section 5.2 The Encoding Declaration Section 5.3 Text Declarations Section 5.4 XML-Defined Character Sets Section 5.5 Unicode Section 5.6 ISO Character Sets Section 5.7 Platform-Dependent Character Sets Section 5.8 Converting Between Character Sets Section 5.9 The Default Character Set for XML Documents Section 5.10 Character References Section 5.11 xml:lang Part II: Narrative-Like Documents Chapter XML as a Document Format Section 6.1 SGML's Legacy Section 6.2 Narrative Document Structures Section 6.3 TEI Section 6.4 DocBook Section 6.5 OpenOffice Section 6.6 WordprocessingML Section 6.7 Document Permanence Section 6.8 Transformation and Presentation Chapter XML on the Web Section 7.1 XHTML Section 7.2 Direct Display of XML in Browsers Section 7.3 Authoring Compound Documents with Modular XHTML Section 7.4 Prospects for Improved Web Search Methods Chapter XSL Transformations (XSLT) Section 8.1 An Example Input Document Section 8.2 xsl:stylesheet and xsl:transform Section 8.3 Stylesheet Processors Section 8.4 Templates and Template Rules Section 8.5 Calculating the Value of an Element with xsl:value-of Section 8.6 Applying Templates with xsl:apply-templates Section 8.7 The Built-in Template Rules Section 8.8 Modes Section 8.9 Attribute Value Templates Section 8.10 XSLT and Namespaces This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Section 8.10 XSLT and Namespaces Section 8.11 Other XSLT Elements Chapter XPath Section 9.1 The Tree Structure of an XML Document Section 9.2 Location Paths Section 9.3 Compound Location Paths Section 9.4 Predicates Section 9.5 Unabbreviated Location Paths Section 9.6 General XPath Expressions Section 9.7 XPath Functions Chapter 10 XLinks Section 10.1 Simple Links Section 10.2 Link Behavior Section 10.3 Link Semantics Section 10.4 Extended Links Section 10.5 Linkbases Section 10.6 DTDs for XLinks Section 10.7 Base URIs Chapter 11 XPointers Section 11.1 XPointers on URLs Section 11.2 XPointers in Links Section 11.3 Shorthand Pointers Section 11.4 Child Sequences Section 11.5 Namespaces Section 11.6 Points Section 11.7 Ranges Chapter 12 XInclude Section 12.1 The include Element Section 12.2 Including Text Files Section 12.3 Content Negotiation Section 12.4 Fallbacks Section 12.5 XPointers Chapter 13 Cascading Style Sheets (CSS) Section 13.1 The Levels of CSS Section 13.2 CSS Syntax Section 13.3 Associating Stylesheets with XML Documents Section 13.4 Selectors Section 13.5 The Display Property Section 13.6 Pixels, Points, Picas, and Other Units of Length Section 13.7 Font Properties Section 13.8 Text Properties Section 13.9 Colors Chapter 14 XSL Formatting Objects (XSL-FO) Section 14.1 XSL Formatting Objects Section 14.2 The Structure of an XSL-FO Document Section 14.3 Laying Out the Master Pages Section 14.4 XSL-FO Properties Section 14.5 Choosing Between CSS and XSL-FO Chapter 15 Resource Directory Description Language (RDDL) Section 15.1 What's at the End of a Namespace URL? Section 15.2 RDDL Syntax Section 15.3 Natures Section 15.4 Purposes This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Part III: Record-Like Documents Chapter 16 XML as a Data Format Section 16.1 Why Use XML for Data? Section 16.2 Developing Record-Like XML Formats Section 16.3 Sharing Your XML Format Chapter 17 XML Schemas Section 17.1 Overview Section 17.2 Schema Basics Section 17.3 Working with Namespaces Section 17.4 Complex Types Section 17.5 Empty Elements Section 17.6 Simple Content Section 17.7 Mixed Content Section 17.8 Allowing Any Content Section 17.9 Controlling Type Derivation Chapter 18 Programming Models Section 18.1 Common XML Processing Models Section 18.2 Common XML Processing Issues Section 18.3 Generating XML Documents Chapter 19 Document Object Model (DOM) Section 19.1 DOM Foundations Section 19.2 Structure of the DOM Core Section 19.3 Node and Other Generic Interfaces Section 19.4 Specific Node-Type Interfaces Section 19.5 The DOMImplementation Interface Section 19.6 DOM Level Interfaces Section 19.7 Parsing a Document with DOM Section 19.8 A Simple DOM Application Chapter 20 Simple API for XML (SAX) Section 20.1 The ContentHandler Interface Section 20.2 Features and Properties Section 20.3 Filters Part IV: Reference Chapter 21 XML Reference Section 21.1 How to Use This Reference Section 21.2 Annotated Sample Documents Section 21.3 XML Syntax Section 21.4 Constraints Section 21.5 XML 1.0 Document Grammar Section 21.6 XML 1.1 Document Grammar Chapter 22 Schemas Reference Section 22.1 The Schema Namespaces Section 22.2 Schema Elements Section 22.3 Built-in Types Section 22.4 Instance Document Attributes Chapter 23 XPath Reference Section 23.1 The XPath Data Model Section 23.2 Data Types Section 23.3 Location Paths Section 23.4 Predicates Section 23.5 XPath Functions Chapter 24 XSLT Reference Section 24.1 The XSLT Namespace This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Section 24.1 The XSLT Namespace Section 24.2 XSLT Elements Section 24.3 XSLT Functions Section 24.4 TrAX Chapter 25 DOM Reference Section 25.1 Object Hierarchy Section 25.2 Object Reference Chapter 26 SAX Reference Section 26.1 The org.xml.sax Package Section 26.2 The org.xml.sax.helpers Package Section 26.3 SAX Features and Properties Section 26.4 The org.xml.sax.ext Package Chapter 27 Character Sets Section 27.1 Character Tables Section 27.2 HTML4 Entity Sets Section 27.3 Other Unicode Blocks Colophon Index < Day Day Up > This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > Copyright © 2004, 2002, 2001 O'Reilly Media, Inc All rights reserved Printed in the United States of America Published by O'Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472 O'Reilly books may be purchased for educational, business, or sales promotional use Online editions are also available for most titles (http://safari.oreilly.com) For more information, contact our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com Nutshell Handbook, the Nutshell Handbook logo, and the O'Reilly logo are registered trademarks of O'Reilly Media, Inc The In a Nutshell series designations, XML in a Nutshell, the image of a peafowl, and related trade dress are trademarks of O'Reilly Media, Inc 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 O'Reilly Media, Inc was aware of a trademark claim, the designations have been printed in caps or initial caps While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein < Day Day Up > This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > Preface In the last few years, XML has been adopted in fields as diverse as law, aeronautics, finance, insurance, robotics, multimedia, hospitality, travel, art, construction, telecommunications, software, agriculture, physics, journalism, theology, retail, and comics XML has become the syntax of choice for newly designed document formats across almost all computer applications It's used on Linux, Windows, Macintosh, and many other computer platforms Mainframes on Wall Street trade stocks with one another by exchanging XML documents Children playing games on their home PCs save their documents in XML Sports fans receive real-time game scores on their cell phones in XML XML is simply the most robust, reliable, and flexible document syntax ever invented XML in a Nutshell is a comprehensive guide to the rapidly growing world of XML It covers all aspects of XML, from the most basic syntax rules, to the details of DTD and schema creation, to the APIs you can use to read and write XML documents in a variety of programming languages < Day Day Up > This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > What This Book Covers There are thousands of formally established XML applications from the W3C and other standards bodies, such as OASIS and the Object Management Group There are even more informal, unstandardized applications from individuals and corporations, such as Microsoft's Channel Definition Format and John Guajardo's Mind Reading Markup Language This book cannot cover them all, any more than a book on Java could discuss every program that has ever been or might ever be written in Java This book focuses primarily on XML itself It covers the fundamental rules that all XML documents and authors must adhere to, from a web designer who uses SMIL to add animations to web pages to a C++ programmer who uses SOAP to exchange serialized objects with a remote database This book also covers generic supporting technologies that have been layered on top of XML and are used across a wide range of XML applications These technologies include: XLink An attribute-based syntax for hyperlinks between XML and non-XML documents that provide the simple, onedirectional links familiar from HTML, multidirectional links between many documents, and links between documents to which you don't have write access XSLT An XML application that describes transformations from one document to another in either the same or different XML vocabularies XPointer A syntax for URI fragment identifiers that selects particular parts of the XML document referred to by the URI— often used in conjunction with an XLink XPath A non-XML syntax used by both XPointer and XSLT for identifying particular pieces of XML documents For example, an XPath can locate the third address element in the document or all elements with an email attribute whose value is elharo@metalab.unc.edu XInclude A means of assembling large XML documents by combining other complete documents and document fragments Namespaces A means of distinguishing between elements and attributes from different XML vocabularies that have the same name; for instance, the title of a book and the title of a web page in a web page about books Schemas An XML vocabulary for describing the permissible contents of XML documents from other XML vocabularies SAX The Simple API for XML, an event-based application programming interface implemented by many XML parsers DOM The Document Object Model, a language-neutral, tree-oriented API that treats an XML document as a set of nested objects with various properties This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com XHTML An XMLized version of HTML that can be extended with other XML applications, such as MathML and SVG RDDL The Resource Directory Description Language, an XML application based on XHTML for documents placed at the end of namespace URLs All these technologies, whether defined in XML (XLinks, XSLT, namespaces, schemas, XHTML, XInclude, and RDDL) or in another syntax (XPointers, XPath, SAX, and DOM), are used in many different XML applications This book does not provide in-depth coverage of XML applications that are relevant to only some users of XML, such as: SVG Scalable Vector Graphics, a W3C-endorsed standard XML encoding of line art MathML The Mathematical Markup Language, a W3C-endorsed standard XML application used for embedding equations in web pages and other documents RDF The Resource Description Framework, a W3C-standard XML application used for describing resources, with a particular focus on the sort of metadata one might find in a library card catalog Occasionally we use one or more of these applications in an example, but we not cover all aspects of the relevant vocabulary in depth While interesting and important, these applications (and thousands more like them) are intended primarily for use with special software that knows their formats intimately For instance, most graphic designers not work directly with SVG Instead, they use their customary tools, such as Adobe Illustrator, to create SVG documents They may not even know they're using XML This book focuses on standards that are relevant to almost all developers working with XML We investigate XML technologies that span a wide range of XML applications, not those that are relevant only within a few restricted domains < Day Day Up > This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > Colophon Our look is the result of reader comments, our own experimentation, and feedback from distribution channels Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects The animal on the cover of XML in a Nutshell, Third Edition, is a peafowl, the largest bird in the Phasianinae family, which also includes pheasants and turkeys People often incorrectly call peafowl peacocks Peacocks are actually male peafowl; the females are called peahens Two wild peafowl species exist today: the Indian peafowl (Pavo cristatus) and the Green peafowl of Southeast Asia (Pavo muticus), which may be endangered These wild peafowl live in musters of to 12 birds in dense forest near water Though they not fly very well, and so only for short distances, they manage to escape most predators and roost peacefully at night, high up in treetops The peafowl's most famous characteristic, of course, is its beautiful fan of feathers, known as a "train." Each blue-green train feather has a dark spot on its tip that looks much like an eye Peacocks develop especially brilliant plumage, an indicator of sexual maturity, by age three A healthy peacock has a full and vibrant train each year during the spring mating season During this period, peacocks strut their stuff-display their "breeding plumage," as it is called-to attract peahens Scientists theorize that the peacock's performance plays upon the peahen's instinctive drives to find healthy mates in the hope of producing hardy offspring Each summer after the mating season, peafowl shed their train feathers, which are often collected by humans as eye-catching souvenirs Marlowe Shaeffer was the production editor and copyeditor for XML in a Nutshell, Third Edition Jane Ellin was the proofreader Sarah Sherman and Claire Cloutier provided quality control James Quill provided production assistance Ellen Troutman-Zaig wrote the index Ellie Volckhausen designed the cover of this book, based on a series design by Edie Freedman The cover image is an original illustration created by Susan Hart Clay Fernald produced the cover layout with QuarkXPress 4.1 using Adobe's ITC Garamond font Melanie Wang designed the interior layout, based on a series design by David Futato This book was converted by Joe Wizda to FrameMaker 5.5.6 with a format conversion tool created by Erik Ray, Jason McIntosh, Neil Walls, and Mike Sierra that uses Perl and XML technologies The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSans Mono Condensed The tables in Chapter 27 were produced using Code2000, Code2001, Arial Unicode MS, Tibetan Machine Web, Tibetan Machine Uni, Doulos SIL, and PakType Naqsh fonts The illustrations that appear in the book were produced by Robert Romano and Jessamyn Read using Macromedia FreeHand and Adobe Photoshop The tip and warning icons were drawn by Christopher Bing This colophon was written by Sarah Jane Shangraw and Molly Shangraw The online edition of this book was created by the Safari production group (John Chodacki, Becki Maisch, and Ellie Cutler) using a set of Frame-to-XML conversion and cleanup tools written and maintained by Erik Ray, Benn Salter, John Chodacki, Ellie Cutler, and Jeff Liggett < Day Day Up > This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > Part I: XML Concepts < Day Day Up > This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > Part II: Narrative-Like Documents < Day Day Up > This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > Part III: Record-Like Documents < Day Day Up > This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > Part IV: Reference < Day Day Up > This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > Copyright © 2004, 2002, 2001 O'Reilly Media, Inc All rights reserved Printed in the United States of America Published by O'Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472 O'Reilly books may be purchased for educational, business, or sales promotional use Online editions are also available for most titles (http://safari.oreilly.com) For more information, contact our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com Nutshell Handbook, the Nutshell Handbook logo, and the O'Reilly logo are registered trademarks of O'Reilly Media, Inc The In a Nutshell series designations, XML in a Nutshell, the image of a peafowl, and related trade dress are trademarks of O'Reilly Media, Inc 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 O'Reilly Media, Inc was aware of a trademark claim, the designations have been printed in caps or initial caps While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein < Day Day Up > This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > What This Book Covers There are thousands of formally established XML applications from the W3C and other standards bodies, such as OASIS and the Object Management Group There are even more informal, unstandardized applications from individuals and corporations, such as Microsoft's Channel Definition Format and John Guajardo's Mind Reading Markup Language This book cannot cover them all, any more than a book on Java could discuss every program that has ever been or might ever be written in Java This book focuses primarily on XML itself It covers the fundamental rules that all XML documents and authors must adhere to, from a web designer who uses SMIL to add animations to web pages to a C++ programmer who uses SOAP to exchange serialized objects with a remote database This book also covers generic supporting technologies that have been layered on top of XML and are used across a wide range of XML applications These technologies include: XLink An attribute-based syntax for hyperlinks between XML and non-XML documents that provide the simple, onedirectional links familiar from HTML, multidirectional links between many documents, and links between documents to which you don't have write access XSLT An XML application that describes transformations from one document to another in either the same or different XML vocabularies XPointer A syntax for URI fragment identifiers that selects particular parts of the XML document referred to by the URI— often used in conjunction with an XLink XPath A non-XML syntax used by both XPointer and XSLT for identifying particular pieces of XML documents For example, an XPath can locate the third address element in the document or all elements with an email attribute whose value is elharo@metalab.unc.edu XInclude A means of assembling large XML documents by combining other complete documents and document fragments Namespaces A means of distinguishing between elements and attributes from different XML vocabularies that have the same name; for instance, the title of a book and the title of a web page in a web page about books Schemas An XML vocabulary for describing the permissible contents of XML documents from other XML vocabularies SAX The Simple API for XML, an event-based application programming interface implemented by many XML parsers DOM The Document Object Model, a language-neutral, tree-oriented API that treats an XML document as a set of nested objects with various properties This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com XHTML An XMLized version of HTML that can be extended with other XML applications, such as MathML and SVG RDDL The Resource Directory Description Language, an XML application based on XHTML for documents placed at the end of namespace URLs All these technologies, whether defined in XML (XLinks, XSLT, namespaces, schemas, XHTML, XInclude, and RDDL) or in another syntax (XPointers, XPath, SAX, and DOM), are used in many different XML applications This book does not provide in-depth coverage of XML applications that are relevant to only some users of XML, such as: SVG Scalable Vector Graphics, a W3C-endorsed standard XML encoding of line art MathML The Mathematical Markup Language, a W3C-endorsed standard XML application used for embedding equations in web pages and other documents RDF The Resource Description Framework, a W3C-standard XML application used for describing resources, with a particular focus on the sort of metadata one might find in a library card catalog Occasionally we use one or more of these applications in an example, but we not cover all aspects of the relevant vocabulary in depth While interesting and important, these applications (and thousands more like them) are intended primarily for use with special software that knows their formats intimately For instance, most graphic designers not work directly with SVG Instead, they use their customary tools, such as Adobe Illustrator, to create SVG documents They may not even know they're using XML This book focuses on standards that are relevant to almost all developers working with XML We investigate XML technologies that span a wide range of XML applications, not those that are relevant only within a few restricted domains < Day Day Up > This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > What's New in the Third Edition XML has not stood still in the two years since the second edition of XML in a Nutshell was published The single most obvious change is that this edition now covers XML 1.1 However, the genuine changes in XML 1.1 are not as large as a version number increase would imply In fact, if you don't speak Mongolian, Burmese, Amharic, Cambodian, or a few other less common languages, there's very little new material of interest in XML 1.1 In almost every way that practically matters, XML 1.0 and 1.1 are the same Certainly there's a lot less difference between XML 1.0 and XML 1.1 than there was between Java 1.0 and Java 1.1 Therefore, we will mostly discuss XML in this book as one unified thing, and only refer specifically to XML 1.1 on those rare occasions where the two versions are in fact different Probably about 98% of this book applies equally well to both XML 1.0 and XML 1.1 We have also added a new chapter covering XInclude, a recent W3C invention for assembling large documents out of smaller documents and pieces thereof Elliotte is responsible for almost half of the early implementations of XInclude, as well as having written possibly the first book that used XInclude as an integral part of the production process, so it's a subject of particular interest to us Other chapters throughout the book have been rewritten to reflect the impact of XML 1.1 on their subject matter, as well as independent changes their technologies have undergone in the last two years Many topics have been upgraded to the latest versions of various specifications, including: SAX 2.0.1 Namespaces 1.1 DOM Level XPointer 1.0 Unicode 4.0.1 Finally, many small errors and omissions were corrected throughout the book < Day Day Up > This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > Organization of the Book Part I, introduces the fundamental standards that form the essential core of XML to which all XML applications and software must adhere It teaches you about well-formed XML, DTDs, namespaces, and Unicode as quickly as possible Part II, explores technologies that are used mostly for narrative XML documents, such as web pages, books, articles, diaries, and plays You'll learn about XSLT, CSS, XSL-FO, XLinks, XPointers, XPath, XInclude, and RDDL One of the most unexpected developments in XML was its enthusiastic adoption for data-heavy structured documents such as spreadsheets, financial statistics, mathematical tables, and software file formats Part III, explores the use of XML for such applications This part focuses on the tools and APIs needed to write software that processes XML, including SAX, DOM, and schemas Finally, Part IV, is a series of quick-reference chapters that form the core of any Nutshell Handbook These chapters give you detailed syntax rules for the core XML technologies, including XML, DTDs, schemas, XPath, XSLT, SAX, and DOM Turn to this section when you need to find out the precise syntax quickly for something you know you can but don't remember exactly how to < Day Day Up > This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > Conventions Used in This Book Constant width is used for: Anything that might appear in an XML document, including element names, tags, attribute values, entity references, and processing instructions Anything that might appear in a program, including keywords, operators, method names, class names, and literals Constant width bold is used for: User input Emphasis in code examples and fragments Constant width italic is used for: Replaceable elements in code statements Italic is used for: New terms where they are defined Emphasis in body text Pathnames, filenames, and program names (However, if the program name is also the name of a Java class, it is written in constant-width font, like other class names.) Host and domain names (cafeconleche.org) This icon indicates a tip, suggestion, or general note This icon indicates a warning or caution Significant code fragments, complete programs, and documents are generally placed into a separate paragraph, like this: Alan Turing XML is case-sensitive The PERSON element is not the same thing as the person or Person element Case-sensitive This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com XML is case-sensitive The PERSON element is not the same thing as the person or Person element Case-sensitive languages not always allow authors to adhere to standard English grammar It is usually possible to rewrite the sentence so the two not conflict, and, when possible, we have endeavored to so However, on rare occasions when there is simply no way around the problem, we let standard English come up the loser Finally, although most of the examples used here are toy examples unlikely to be reused, a few have real value Please feel free to reuse them or any parts of them in your own code No special permission is required As far as we are concerned, they are in the public domain (although the same is definitely not true of the explanatory text) < Day Day Up > This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > Request for Comments We enjoy hearing from readers with general comments about how this book could be better, specific corrections, or topics you would like to see covered You can reach the authors by sending email to elharo@metalab.unc.edu and smeans@ewm.biz Please realize, however, that we each receive several hundred pieces of email a day and cannot respond to everyone personally For the best chance of getting a personal response, please identify yourself as a reader of this book Also, please send the message from the account you want us to reply to and make sure that your reply-to address is properly set There's nothing so frustrating as spending an hour or more carefully researching the answer to an interesting question and composing a detailed response, only to have it bounce because the correspondent sent the message from a public terminal and neglected to set the browser preferences to include their actual email address The information in this book has been tested and verified, but you may find that features have changed (or you may even find mistakes) We believe the old saying, "If you like this book, tell your friends If you don't like it, tell us." We're especially interested in hearing about mistakes As hard as the authors and editors worked on this book, inevitably there are a few mistakes and typographical errors that slipped by us If you find a mistake or a typo, please let us know so we can correct it in a future printing Please send any errors you find directly to the authors at the previously listed email addresses You can also address comments and questions concerning this book to the publisher: O'Reilly Media, Inc 1005 Gravenstein Highway North Sebastopol, CA 95472 (800) 998-9938 (in the United States or Canada) (707) 829-0515 (international or local) (707) 829-0104 (fax) We have a web site for the book, where we list errata, examples, and any additional information You can access this site at: http://www.cafeconleche.org/books/xian3/ Before reporting errors, please check this web site to see if we have already posted a fix To ask technical questions or comment on the book, you can send email to the authors directly or send your questions to the publisher at: bookquestions@oreilly.com For more information about other O'Reilly books, conferences, software, Resource Centers, and the O'Reilly Network, see the web sites at: http://www.oreilly.com http://xml.oreilly.com http://www.xml.com < Day Day Up > This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > Acknowledgments Many people were involved in the production of this book The original editor, John Posner, got this book rolling and provided many helpful comments that substantially improved the book When John moved on, Laurie Petrycki shepherded this book to its completion Simon St.Laurent took up the mantle of editor for the second and third editions The eagle-eyed Jeni Tennison read the entire manuscript from start to finish and caught many errors, large and small Without her attention, this book would not be nearly as accurate Stephen Spainhour deserves special thanks for his work on the reference section His efforts in organizing and reviewing material helped create a better book We'd like to thank Matt Sergeant, Didier P H Martin, Steven Champeon, and Norm Walsh for their thorough technical review of the manuscript and thoughtful suggestions James Kass's Code2000 and Code2001 fonts were invaluable in producing Chapter 27 We'd also like to thank everyone who has worked so hard to make XML such a success over the last few years and thereby given us something to write about There are so many of these people that we can only list a few In alphabetical order we'd like to thank Tim Berners-Lee, Jonathan Borden, Jon Bosak, Tim Bray, David Brownell, Mike Champion, James Clark, John Cowan, Roy Fielding, Charles Goldfarb, Jason Hunter, Arnaud Le Hors, Michael Kay, Deborah Lapeyre Keiron Liddle, Murato Makoto, Eve Maler, Brett McLaughlin, David Megginson, David Orchard, Walter E Perry, Paul Prescod, Jonathan Robie, Arved Sandstrom, C M Sperberg-McQueen, James Tauber, Henry S Thompson, B Tommie Usdin, Eric van der Vlist, Daniel Veillard, Lauren Wood, and Mark Wutka Our apologies to everyone we unintentionally omitted Elliotte would like to thank his agent, David Rogelberg, who convinced him that it was possible to make a living writing books like this rather than working in an office The entire IBiblio crew has also helped him to communicate better with his readers in a variety of ways over the last several years All these people deserve much thanks and credit Finally, as always, he offers his largest thanks to his wife, Beth, without whose love and support this book would never have happened Scott would most like to thank his lovely wife, Celia, who has already spent way too much time as a "computer widow." He would also like to thank his daughter Selene for understanding why Daddy can't play with her when he's "working" and Skyler for just being himself Also, he'd like to thank the team at Enterprise Web Machines for helping him make time to write Finally, he would like to thank John Posner for getting him into this, Laurie Petrycki for working with him when things got tough, and Simon St.Laurent for his overwhelming patience in dealing with an always-overcommitted author —Elliotte Rusty Harold elharo@metalab.unc.edu —W Scott Means smeans@ewm.biz < Day Day Up > This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com < Day Day Up > Preface In the last few years, XML has been adopted in fields as diverse as law, aeronautics, finance, insurance, robotics, multimedia, hospitality, travel, art, construction, telecommunications, software, agriculture, physics, journalism, theology, retail, and comics XML has become the syntax of choice for newly designed document formats across almost all computer applications It's used on Linux, Windows, Macintosh, and many other computer platforms Mainframes on Wall Street trade stocks with one another by exchanging XML documents Children playing games on their home PCs save their documents in XML Sports fans receive real-time game scores on their cell phones in XML XML is simply the most robust, reliable, and flexible document syntax ever invented XML in a Nutshell is a comprehensive guide to the rapidly growing world of XML It covers all aspects of XML, from the most basic syntax rules, to the details of DTD and schema creation, to the APIs you can use to read and write XML documents in a variety of programming languages < Day Day Up > ... Section 1.2 What XML Is Not Section 1.3 Portable Data Section 1.4 How XML Works Section 1.5 The Evolution of XML Chapter XML Fundamentals Section 2.1 XML Documents and XML Files Section 2.2 Elements,... Data Section 2.3 Attributes Section 2.4 XML Names Section 2.5 References Section 2.6 CDATA Sections Section 2.7 Comments Section 2.8 Processing Instructions Section 2.9 The XML Declaration Section... 16 XML as a Data Format Section 16.1 Why Use XML for Data? Section 16.2 Developing Record-Like XML Formats Section 16.3 Sharing Your XML Format Chapter 17 XML Schemas Section 17.1 Overview Section

Ngày đăng: 19/04/2019, 15:10

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan