1. Trang chủ
  2. » Thể loại khác

John wiley sons xml bible 2nd ed (1249 pages) 2001 (by laxxuss)

1.2K 216 0

Đ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

Cấu trúc

  • XML Bible 2nd Edition

    • Praise for Elliotte Rusty Harold’s XML Bible

    • XML Bible Second Edition

      • Credits

      • About the Author

      • Preface

        • Who You Are

        • What’s New in the Second Edition

        • What You Need to Know

        • What You’ll Learn

        • How the Book Is Organized

        • What You Need

        • How to Use This Book

        • What the Icons Mean

        • About the Companion CD-ROM

        • Reach Out

      • Acknowledgments

      • Contents at a Glance

      • Table of Contents

  • Part I: Introducing XML

    • Chapter 1: An Eagle’s Eye View of XML

      • What Is XML?

      • Why Are Developers Excited About XML?

      • The Life of an XML Document

      • Related Technologies

    • Chapter 2: XML Applications

      • XML Applications

      • XML for XML

      • Behind-the-Scene Uses of XML

    • Chapter 3: Your First XML Document

      • Hello XML

      • Exploring the Simple XML Document

      • Assigning Meaning to XML Tags

      • Writing a Style Sheet for an XML Document

      • Attaching a Style Sheet to an XML Document

    • Chapter 4: Structuring Data

      • Examining the Data

      • XMLizing the Data

      • The Advantages of the XML Format

      • Preparing a Style Sheet for Document Display

    • Chapter 5: Attributes, Empty Tags, and XSL

      • Attributes

      • Attributes versus Elements

      • Empty Elements and Empty Element Tags

      • XSL

    • Chapter 6: Well-formedness

      • Well-Formedness Rules

      • XML Documents

      • Text in XML

      • Elements and Tags

      • Attributes

      • Entity References

      • Comments

      • Processing Instructions

      • CDATA Sections

      • Well-Formed HTML

    • Chapter 7: Foreign Languages and Non-Roman Text

      • Non-Roman Scripts on the Web

      • Scripts, Character Sets, Fonts, and Glyphs

      • Legacy Character Sets

      • The Unicode Character Set

      • How to Write XML in Unicode

  • Part II: Document Type Definitions

    • Chapter 8: DTDs and Validity

      • Document Type Definitions

      • Element Declarations

      • DTD Files

      • Document Type Declarations

      • Validating Against a DTD

    • Chapter 9: Element Declarations

      • Analyzing the Document

      • The ANY Content Model

      • The #PCDATA Content Model

      • Child Elements

      • Sequences

      • One or More Children

      • Zero or More Children

      • Zero or One Child

      • Grouping with Parentheses

      • Choices

      • Mixed Content

      • Empty Elements

      • Comments in DTDs

    • Chapter 10: Entity Declarations

      • What Is an Entity?

      • Internal General Entities

      • External General Entities

      • Internal Parameter Entities

      • External Parameter Entities

      • Building a Document from Pieces

    • Chapter 11: Attribute Declarations

      • What Is an Attribute?

      • Declaring Attributes in DTDs

      • Declaring Multiple Attributes

      • Specifying Default Values for Attributes

      • Attribute Types

      • Predefined Attributes

      • A DTD for Attribute-Based Baseball Statistics

    • Chapter 12: Unparsed Entities, Notations, and Non-XML Data

      • Notations

      • Unparsed Entities

      • Processing Instructions

      • Conditional Sections in DTDs

    • Chapter 13: Namespaces

      • The Need for Namespaces

      • Namespace Syntax

      • Namespaces and Validity

  • Part III: Style Languages

    • Chapter 14: CSS Style Sheets

      • What Are Cascading Style Sheets?

      • Comments in CSS

      • Selecting Elements

      • Inheritance

      • Cascades

      • Different Rules for Different Media

      • Importing Style Sheets

      • Style Sheet Character Sets

    • Chapter 15: CSS Layouts

      • CSS Units

      • The Display Property

      • Box Properties

      • Size

      • Positioning

      • Formatting Pages

    • Chapter 16: CSS Text Styles

      • Font Properties

      • The Color Property

      • Text Properties

      • Background Properties

      • Visibility

      • Cursors

      • The Content Property

      • Aural Style Sheets

    • Chapter 17: XSL Transformations

      • What Is XSL?

      • Overview of XSL Transformations

      • XSL Templates

      • Computing the Value of a Node with xsl:value-of

      • Processing Multiple Elements with xsl:for-each

      • Patterns for Matching Nodes

      • XPath Expressions for Selecting Nodes

      • The Default Template Rules

      • Deciding What Output to Include

      • Copying the Context Node with xsl:copy

      • Counting Nodes with xsl:number

      • Sorting Output Elements

      • Modes

      • Defining Constants with xsl:variable

      • Named Templates

      • Passing Parameters to Templates

      • Stripping and Preserving White Space

      • Making Choices

      • Merging Multiple Style Sheets

      • Output Methods

    • Chapter 18: XSL Formatting Objects

      • Formatting Objects and Their Properties

      • Page Layout

      • Content

      • Leaders and Rules

      • Graphics

      • Links

      • Lists

      • Tables

      • Inlines

      • Footnotes

      • Floats

      • Formatting Properties

  • Part IV: Supplemental Technologies

    • Chapter 19: XLinks

      • XLinks versus HTML Links

      • Linking Elements

      • Descriptions of the Remote Resource

      • Link Behavior

      • Extended Links

      • Extended Link Syntax

      • Arcs

      • Out-of-Line Links

    • Chapter 20: XPointers

      • Why Use XPointers?

      • XPointer Examples

      • A Concrete Example

      • Location Paths, Steps, and Sets

      • The Root Node

      • Axes

      • Node Tests

      • Predicates

      • Functions that Return Node Sets

      • Points

      • Ranges

      • Child Sequences

    • Chapter 21: The Resource Description Framework

      • What Is RDF?

      • RDF Statements

      • Basic RDF Syntax

      • Abbreviated RDF Syntax

      • Containers

      • RDF Schemas

  • Part V: XML Applications

    • Chapter 22: XHTML

      • Why Validate HTML?

      • Moving to XHTML

      • What’s New in XHTML

    • Chapter 23: The Wireless Markup Language

      • What Is WML?

      • Hello WML

      • Basic Text Markup

      • Cards and Links

      • Selections

      • The Options Menu

      • Events

      • The Header

      • Variables

      • Talking Back to the Server

    • Chapter 24: Schemas

      • What’s Wrong with DTDs?

      • What is a Schema?

      • The W3C XML Schema Language

      • Hello Schemas

      • Complex Types

      • Grouping

      • Simple Types

      • Derived Types

      • Empty Elements

      • Attributes

      • Namespaces

      • Annotations

    • Chapter 25: Scalable Vector Graphics

      • What Is SVG?

      • A Simple SVG Document

      • Embedding SVG Pictures in Web Pages

      • Simple Shapes

      • Paths

      • Text

      • Bitmapped Images

      • Coordinate Systems and Viewports

      • Grouping Shapes

      • Referencing Shapes

      • Transformations

      • Linking

      • Metadata

      • SVG Editors

    • Chapter 26: The Vector Markup Language

      • What Is VML?

      • Drawing with a Keyboard

      • Positioning VML Shapes with CSS Properties

      • VML in Microsoft Office

    • Chapter 27: The Channel Definition Format

      • What Is the Channel Definition Format?

      • Creating Channels

      • Describing the Channel

      • Scheduling Updates

      • Precaching and Web Crawling

      • The Reader Access Log

      • The BASE Attribute

      • The LASTMOD Attribute

      • The USAGE Element

    • Chapter 28: Designing a New XML Application

      • Organization of the Data

      • The Person DTD

      • The Family DTD

      • The Source DTD

      • The Family Tree DTD

      • Designing a Style Sheet for Family Trees

  • Appendix A: What’s on the CD-ROM

    • Browsers

    • Parsers

    • Specifications

    • Examples

    • Source Code

    • Utilities

    • PDF

  • Appendix B: XML Reference Material

    • XML BNF Grammar

    • Well-Formedness Constraints

    • Validity Constraints

  • Appendix C: The XML 1.0 Specification, Second Edition

    • What’s New in the Second Edition

    • Extensible Markup Language XML 1.0 Second Edition

    • Errata for Extensible Markup Language XML 1.0 Second Edition

  • Index

    • Symbols & Numbers

    • A

    • B

    • C

    • D

    • E

    • F

    • G

    • H

    • I

    • J

    • K

    • L

    • M

    • N

    • O

    • P

    • Q

    • R

    • S

    • T

    • U

    • V

    • W

    • X

    • Y

    • Z

  • Hungry Minds, Inc. End-User License Agreement

  • CD-ROM Installation Instructions

Nội dung

4760-7 Cover 4/18/01 10:45 AM Page If XML can it, you can it too Now revised and expanded to cover the latest XML technologies and applications, this all-in-one tutorial and reference shows you step by step how to put the power of XML to work in your Web pages From document type definitions and style sheets to XPointers, schemas, the Wireless Markup Language, XHTML and other advanced tools and applications, XML expert Elliotte Rusty Harold gives you all the know-how and examples you need to integrate XML with HTML, solve real-world development challenges, and create data-driven content • Create well-formed XML documents • Place international characters in documents • Validate documents against DTDs and schemas • Use entities to build large documents from smaller parts • Embed non-XML data in your documents • Format your documents with CSS and XSL style sheets • Connect documents with XLinks and XPointers • Merge different XML vocabularies with namespaces • Write metadata for Web pages using RDF • Harness XML for site design, vector graphics, and other real-world applications Write Web pages in foreign languages and diverse scripts C O M P R E H E N S I V E Publish XML documents on the Web www.hungryminds.com System Requirements: Java 1.1 or later compatible platform such as Mac OS 8.5 or later, Windows 95/98/Me/NT/2000, Linux, or Solaris $49.99 USA $74.99 Canada £39.99 UK incl VAT Reader Level: Shelving Category: Beginning to Advanced Web Development/XML ISBN 0-7645-4760-7 *85 -AEHFHa Master XML Harness the power of CSS and XSL to format XML documents Take XML to the limit using XLinks, XPointers, Schemas, SVG, and XHTML ,!7IA7G4-fehgah!:p;o;t;T;T HAROLD Bible XML code and authoring tools on CD-ROM! Now updated! Covers XML 1.0 second edition fundamentals including elements, tags, attributes, DTDs, and namespaces 2nd Edition Shareware programs are fully functional, free trial versions of copyrighted programs If you like particular programs, register with their authors for a nominal fee and receive licenses, enhanced versions, and technical support Freeware programs are free, copyrighted games, applications, and utilities You can copy them to as many PCs as you like—free—but they have no technical support —Sean Rhody, Technical Editor, XML Journal ONE HUNDRED PERCENT ONE HUNDRED PERCENT XML Resources on CD-ROM • Code for all examples in the book, plus additional examples • XML authoring tools, including expat, XT, Xalan, Xerces, Batik, FOP, SAXON, HTML Tidy, and Mozilla • World Wide Web Consortium XML standards 100% COMPREHENSIVE AUTHORITATIVE WHAT YOU NEED XML Inside, you’ll find complete coverage of XML 100% “The XML Bible provides complete coverage on all XML-related topics and will be an essential resource for any developer.” BONUS CD-ROM! Sample XML code XML authoring tools W3C standards XML 2nd Edition Elliotte Rusty Harold Author of Java Network Programming XML Bible Second Edition Praise for Elliotte Rusty Harold’s XML Bible “Great book! I have about 10 XML books and this is by far the best.” — Edward Blair, Systems Analyst, AT&T “I recommend the XML Bible I found it to be really helpful, as I am a beginner myself It is easy to understand, which I found most useful since I am not a ‘techhead.’” — Marius Holth Hanssen, Independent IT Consultant “I don’t know how to praise Elliotte Rusty Harold enough When I read a technical book, I don’t expect to ENJOY it in the pure sense Oh, I expect to ENJOY increasing my knowledge or to ENJOY the experience of successfully understanding a particularly poorly written passage Your text is enjoyable in the pure sense It is fun to read I don’t have to force myself to pick up XML Bible — I jump for it because I know I will be finding something on each page to make me smile.” — Mike Maddux, Software Architect, Texas Department of Health “Just wanted to take a minute and send you a big thank you for writing XML Bible and Java Beans Without those two books, my life would be so much harder!” — Ove “Lime” Lindström, Java Consultant, Enea Realtime AB XML Bible Second Edition Elliotte Rusty Harold Hungry Minds, Inc New York, NY ✦ Indianapolis, IN ✦ Cleveland, OH XML Bible, Second Edition Published by Hungry Minds, Inc 909 Third Avenue New York, NY 10022 www.hungryminds.com Copyright © 2001 Hungry Minds, Inc All rights reserved No part of this book, including interior design, cover design, and icons, may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording, or otherwise) without the prior written permission of the publisher Library of Congress Control Number: 2001089303 ISBN: 0-7645-4760-7 Printed in the United States of America 10 2B/RX/QV/QR/IN Distributed in the United States by Hungry Minds, Inc Distributed by CDG Books Canada Inc for Canada; by Transworld Publishers Limited in the United Kingdom; by IDG Norge Books for Norway; by IDG Sweden Books for Sweden; by IDG Books Australia Publishing Corporation Pty Ltd for Australia and New Zealand; by TransQuest Publishers Pte Ltd for Singapore, Malaysia, Thailand, Indonesia, and Hong Kong; by Gotop Information Inc for Taiwan; by ICG Muse, Inc for Japan; by Intersoft for South Africa; by Eyrolles for France; by International Thomson Publishing for Germany, Austria, and Switzerland; by Distribuidora Cuspide for Argentina; by LR International for Brazil; by Galileo Libros for Chile; by Ediciones ZETA S.C.R Ltda for Peru; by WS Computer Publishing Corporation, Inc., for the Philippines; by Contemporanea de Ediciones for Venezuela; by Express Computer Distributors for the Caribbean and West Indies; by Micronesia Media Distributor, Inc for Micronesia; by Chips Computadoras S.A de C.V for Mexico; by Editorial Norma de Panama S.A for Panama; by American Bookshops for Finland For general information on Hungry Minds’ products and services 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 For sales inquiries and reseller information, including discounts, premium and bulk quantity sales, and foreign-language translations, please contact our Customer Care department at 800-434-3422, fax 317-572-4002 or write to Hungry Minds, Inc., Attn: Customer Care Department, 10475 Crosspoint Boulevard, Indianapolis, IN 46256 For information on licensing foreign or domestic rights, please contact our Sub-Rights Customer Care department at 212-884-5000 For information on using Hungry Minds’ products and services in the classroom or for ordering examination copies, please contact our Educational Sales department at 800-434-2086 or fax 317-572-4005 For press review copies, author interviews, or other publicity information, please contact our Public Relations department at 317-572-3168 or fax 317-572-4168 For authorization to photocopy items for corporate, personal, or educational use, please contact Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, or fax 978-750-4470 LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND AUTHOR HAVE USED THEIR BEST EFFORTS IN PREPARING THIS BOOK THE PUBLISHER AND AUTHOR MAKE 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 A PARTICULAR PURPOSE THERE ARE NO WARRANTIES WHICH EXTEND BEYOND THE DESCRIPTIONS CONTAINED IN THIS PARAGRAPH NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES REPRESENTATIVES OR WRITTEN SALES MATERIALS THE ACCURACY AND COMPLETENESS OF THE INFORMATION PROVIDED HEREIN AND THE OPINIONS STATED HEREIN ARE NOT GUARANTEED OR WARRANTED TO PRODUCE ANY PARTICULAR RESULTS, AND THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY INDIVIDUAL NEITHER THE PUBLISHER NOR AUTHOR SHALL BE LIABLE FOR ANY LOSS OF PROFIT OR ANY OTHER COMMERCIAL DAMAGES, INCLUDING BUT NOT LIMITED TO SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR OTHER DAMAGES Netscape Communications Corporation has not authorized, sponsored, endorsed, or approved this publication and is not responsible for its content Netscape and the Netscape Communications Corporate Logos, are trademarks and trade names of Netscape Communications Corporation Trademarks: All trademarks are property of their respective owners Hungry Minds, Inc is not associated with any product or vendor mentioned in this book is a trademark of Hungry Minds, Inc Credits Acquisitions Editor Grace Buechlein Permissions Editor Laura Moss Project Editor Sharon Nash Media Development Specialist Gregory Stephens Technical Editor Ken Cox Media Development Coordinator Marisa Pearman Copy Editor Richard H Adin Illustrators Gabriele McCann John Greenough Project Coordinator Nancee Reeves Graphics and Production Specialists Heather Pope, Jill Piscitelli, Kathie Shutte Proofreading and Indexing TECHBOOKS Production Services Cover Image Lawrance Huck Quality Control Technicians David Faust, Andy Hollandbeck, Angel Perez, Dwight Ramsey, Charles Spencer About the Author Elliotte Rusty Harold is an internationally respected writer, programmer, and educator both on the Internet and off He got his start writing FAQ lists for the Macintosh newsgroups on Usenet and has since branched out into books, Web sites, and newsletters He’s an adjunct professor of computer science at Polytechnic University in Brooklyn, New York His Cafe Leche Web site at http://www.ibiblio.org/xml/ has become one of the most popular independent XML sites on the Internet Elliotte is originally from New Orleans, to which he returns periodically in search of a decent bowl of gumbo However, he currently resides in the Prospect Heights neighborhood of Brooklyn with his wife, Beth, and cats, Charm (named after the quark) and Marjorie (named after his mother-in-law) When not writing books, he enjoys working on genealogy, mathematics, and quantum mechanics His previous books include The Java Developer’s Resource, Java Network Programming, Java Secrets, JavaBeans, XML: Extensible Markup Language, and Java I/O For Ma, a great grandmother Preface W elcome to the second edition of the XML Bible When the first edition was published about two years ago, XML was a promising technology with a small but growing niche In the last two years, it has absolutely exploded XML no longer needs to be justified as a good idea In fact, the question developers are asking has changed from “Why XML?” to “Why not XML?” XML has become the data format of choice for fields as diverse as stock trading and graphic design More new programs today are using XML than aren’t A solid understanding of just what XML is and how to use it has become a sine qua non for the computer literate The XML Bible is your introduction to the exciting and fast-growing world of XML With this book, you’ll learn how to write documents in XML and how to use style sheets to convert those documents into HTML so that legacy browsers can read them You’ll also learn how to use document type definitions (DTDs) to describe and validate documents You’ll experience a variety of XML applications in many domains, ranging from finance to vector graphics to genealogy And you’ll learn how to take advantage of XML for your own unique projects, programs, and Web sites Who You Are Unlike most other XML books on the market, the XML Bible discusses XML from the perspective of a Web-page author, not from the perspective of a software developer I don’t spend a lot of time discussing BNF grammars or parsing element trees Instead, I show you how you can use XML and existing tools today to more efficiently produce attractive, exciting, easy-to-use, easy-to-maintain Web sites that keep your readers coming back for more This book is aimed directly at Web-site developers I assume you want to use XML to produce Web sites that are difficult to impossible to create with raw HTML You’ll be amazed to discover that in conjunction with style sheets and a few free tools, XML enables you to things that previously required either custom software costing hundreds to thousands of dollars per developer, or extensive knowledge of programming languages such as Perl None of the software discussed in this book will cost you more than a few minutes of download time None of the tricks require any programming What’s New in the Second Edition For the second edition, this book was rewritten from the ground up While I retained the basic flavor and outline that proved so popular with the first edition, the writing has been tightened up throughout I tried to address all common viii Preface complaints about the first edition For instance, the largest examples are now smaller and easier to digest Where mistakes or misstatements were found, they have been corrected Most important, the text has been brought completely up to date with the state of the XML world in 2001 Many technologies that were rapidly changing, bleeding-edge tools in 1999 (XSLT, XSL-FO, XHTML, XLinks, XPointers, namespaces, etc.), have become the solid rocks on which future XML technologies are being built Thus, it is now possible to offer much more comprehensive and final coverage of these, rather than the somewhat tentative first steps I took in the first edition The world never stands still for long, however In the two years since the first edition appeared, new XML technologies have issued forth at a frightening pace They are discussed here as well, though often with caveats that the details are still subject to change There are several completely new chapters covering many of these cutting-edge applications, including chapters on: ✦ The Extensible Hypertext Markup Language (XHTML) ✦ Scalable Vector Graphics (SVG) ✦ Schemas ✦ The Wireless Markup Language (WML) Even more important than the new chapters are the new sections woven into more familiar chapters Although I made every effort to write more concisely in this edition (My favorite reader comment about the first edition was, “It would seem to me that if you asked the author to write 10,000 words about the colour blue, he would be able to it without breaking into a sweat”), we still ended up with a book 200 pages longer than before, and most of those 200 pages are new material scattered throughout the book If you liked the first edition, I can only surmise that you’re going to like the second edition even more It is in every way a better, more comprehensive, more accurate book If you didn’t like the first edition, I hope you’ll find the second more to your taste What You Need to Know XML does build on top of the underlying infrastructure of the Internet and the Web Consequently, I will assume you know how to ftp files, send e-mail, and load URLs into your Web browser of choice I will also assume you have a reasonable knowledge of HTML at about the level supported by Netscape 1.1 On the other hand, when I discuss newer aspects of HTML that are not yet in widespread use, such as Cascading Style Sheets, I discuss them in depth To be more specific, in this book I assume that you can: ✦ Write a basic HTML page, including links, images, and text, using a text editor ✦ Place that page on a Web server Preface On the other hand, I not assume that you: ✦ Know SGML In fact, this preface is almost the only place in the entire book you’ll see the word SGML used XML is supposed to be simpler and more widespread than SGML It can’t be that if you have to learn SGML first ✦ Are a programmer, whether of Java, Perl, C, or some other language XML is a markup language, not a programming language You don’t need to be a programmer to write XML documents What You’ll Learn This book has one primary goal: to teach you to write XML documents for the Web Fortunately, XML has a decidedly flat learning curve, much like HTML (and unlike SGML) As you learn a little you can a little As you learn a little more, you can a little more Thus the chapters in this book build steadily on one another They are meant to be read in sequence Along the way you’ll learn: ✦ How to author XML documents and deliver them to readers ✦ How semantic tagging makes XML documents easier to maintain and develop than their HTML equivalents ✦ How to post XML documents on Web servers in a form everyone can read ✦ How to make sure your XML is well formed ✦ How to use international characters such as and Ỉ in your documents ✦ How to validate documents against DTDs and schemas ✦ How to use entities to build large documents from smaller parts ✦ How to describe data with attributes ✦ How to embed non-XML data in your documents ✦ How to merge different XML vocabularies with namespaces ✦ How to format your documents with CSS and XSL style sheets ✦ How to connect documents with XLinks and XPointers ✦ How to write metadata for Web pages using RDF In the final section of this book, you’ll see several practical examples of XML being used for real-world applications, including: ✦ Web site design ✦ Schemas ✦ Push ✦ Vector graphics ✦ Genealogy ix 1200 Index ✦ V–V variables Extensible Stylesheet Language Transformations (XSLT), in, 553–554 global, 554 local, 554 precedence, 554 referral, circular, 554 referral, recursive, 554 white space in name, 817 Wireless Markup Language (WML), 816–822 xsl:value-of element, using with, 554 vector graphics See also images bitmaps verses, 884–885 Web-related features, 28 Vector Markup Language (VML) 3D effects, 945 alignment, 951, 956 alternate text, 944 arcs, 946 bitmap images, working with, 945 bounding box size, 942, 944 Cascading Style Sheets (CSS), using with, 949–956 color attributes, 944 coordinate system, 943, 949 curves, 946 described, 939–941 fills, 944, 945 handles, 945 lines, 946 links, 944 measurement units, 949 Microsoft Office, in, 30, 49, 956–963 Microsoft Web site resources, 941, 946 namespace, 941 ovals, 946 paths, 942, 944, 945 polylines, 946 rectangles, 946 shadow effects, 945 shapes, drawing, 941–950, 958–960 shapes, flipping, 951, 955–956 shapes, grouping, 949–950 shapes, positioning, 950–956 shapes, predefined, 946 shapes, referencing, 947 shapes, repeating, 947–948 shapes, rotating, 953–954 size attributes, 944, 947 skew, 945 stroke attributes, 944 text, 945 title display at rollover, 945 Web pages, embedding images in, 30–31, 939–941, 960–963 version attribute SOFTPKG element VERSION attribute, 991 xsl:output, of, 564–565 version declaration, 58, 70 version pseudo-attribute, 266 versions of Extensible Markup Language (XML) 1.0, second edition, 48 2.0, 48 used in this book, 48 vertical-align property, 444 viewBox attribute, 915, 917–919 View$Encoding, 178 viewports, 914–917 See also Scalable Vector Graphics (SVG) visibility property, 463–464, 950 :visited pseudo-class, 369, 370 Visual XML, visually impaired users alternate text, 751, 944 braille media type, 375 Braille Unicode script block, 200 speech synthesis, 472–478, 640–641 VML See Vector Markup Language (VML) vml prefix, 941 vml:arc element, 946 vml:curve element, 946 vml:formulas element, 944 vml:from attribute, 946 vml:group element, 949–950 Index ✦ V–W vml:image element, 946 vml:line element, 946 vml:oval element, 946, 949 vml:path element, 942 vml:polyline element, 941, 946, 949 vml:rect element, 946 VMLRender program, 941 vml:roundrect element, 946 vml:shape element, 942–945 vml:shapetype element, 944, 945, 947–948 vml:to attribute, 946 vocabularies, standard, 44, 45, 709, 712–713, 729–730 voice mail applications, 33–35 voice-family property, 476–477, 641 VoiceXML, 33–35 volume property, 473, 641 W W3C See World Wide Web Consortium (W3C) WAP See Wireless Application Protocol (WAP) WAP Forum, 818 WAP IDE software, 791 WAP simulator software, 791 WAP Toolkit, 791 WAPTiger software, 798 wbmp file format, 789, 798 Web crawling, 978–979 webcasting, 22, 965–966 See also Channel Definition Format (CDF) Well-formed external parsed entity BackusNaur-Form (BNF) rule, 1038, 1065 well-formedness See also specifications under specific topics attributes, 152–154, 743, 1070, 1072, 1073–1074 browser, using to check, 746 CDATA sections, 159–160 character references, 1074 character set, 147 comments, 156–158 constraints, 1069–1076 defined, 1098 Document Type Definitions (DTDs), 1071–1076 elements, 146–152, 1071–1072 end tags, 148, 149, 741, 1071–1072 entity well-formedness constraints, 1071 entity references well-formedness constraints, 154–156, 746, 1071–1076 entity subsets, external, 1071 Extensible Stylesheet Language Formatting Objects (XSL-FO), 579 Hypertext Markup Language (HTML), 161–170 introduced, 56 namespaces, 349–350 parsing, prerequisite for, 144 processing instructions, 158–159 root element, 146–147, 168 rules, 144–145 start tags, 148, 149, 1071–1072 tools, 170–172, 223–225, 745–746 validity versus, 220 White House home page, 163–166 white space attribute values, prohibiting in, 295 attributes, specifying treatment in, 301–303 Backus-Naur-Form (BNF) rule, 1033, 1043 code, in, 71, 148, 302 element names, in, 148 Extensible Stylesheet Language Formatting Objects (XSL-FO), 633 Extensible Stylesheet Language Transformations (XSLT), 557–559 Hypertext Markup Language (HTML) code, in, 302 specifications relating to, 1099, 1106–1107 text, in, 449–451, 557–559, 633 treatment of, default, 71–72, 302 treatment of, specifying, 301–303 variable names, in, 817 XPointer, 701 white-space property, 449–451 1201 1202 Index ✦ W–W white-space-collapse property, 633 widgets, 387, 439 widows property, 424, 425, 626 widows/orphans, 425, 640 width attribute fo:external-graphic element, of, 610 fo:instream-foreign-object element, of, 610 g element, of, 921 image element, of, 913 img element, of, 798 rect element, of, 892 svg element, of, 886, 915 WIDTH Channel Definition Format (CDF) element, 985 width property, 410–412, 637, 760, 761, 951 Window system color keyword, 387 WindowFrame system color keyword, 387 Windows ANSI character set, 194–195 windows, Cascading Style Sheet (CSS) operations, 387 Windows character set support, 185, 186 WindowText system color keyword, 387 Wireless Application Protocol (WAP), 787 Wireless Markup Language (WML) access control, 814–815 action elements, 802–803 alignment, 796, 797–798 anchors, 804–807 browser support, 790, 795, 799 cards, 788, 800 cell phone simulation on PC, 791–794 cell phone support, 791, 799, 818 character set, 815 choice lists, 807–808 client/server communication, 822–824 decks, 788 document type declaration, 788–789 dollar sign, representing in text, 818 dynamic content, 822–824 entity references, 799–800 event handlers, 811–813, 817 font, 795 headers, 814–815 hyphenation, 799–800 Hypertext Markup Language (HTML), similarity to, 794–795 images, 798–799 input fields, 819–820 introduced, 787–788 limitations of wireless, 788 line wrap, 796 links, 800–807, 814 MIME media type, 789–790, 798 options menus, 809–811 paragraphs, 794, 795, 796 root element, 795 security, 806, 815, 816 selections, 807–808, 821 server-side operations, 822–824 spider crawling of WML documents, 814 tables, 796–798 templates, 810–811 user input, 819–820 variables, 816–822 verbosity, avoiding, 794 WMLScript, 818 WML See Wireless Markup Language (WML) wml element, 788 wmlc file format, 789 wmls file format, 789 WMLScript, 818 Word, Microsoft, 956–963 word-spacing property, 441, 631 World Wide Web Consortium (W3C) Amaya browser download, 889 Extensible Markup Language (XML) recommendations, 1090, 1091 namespace recommendations, 333 schema plans, 233, 310 Schema Working Group, 730, 831, 838 XML Core Group, 1147–1148 XML Fragment Working Group, 678 XML Working Group, 1095, 1146–1147 wrap-option property, 633 writing-mode attribute, 585 writing-mode property, 639 Index ✦ X–X X x attribute, 892, 907–908 x1 attribute, 896 x2 attribute, 896 Xalan program (on the CD), 488–491, 1028 x-codes, 308 Xerces parsers, 221–222, 835, 1026 XFDL See Extensible Forms Description Language (XFDL) XHTML See Extensible HyperText Markup Language (XHTML) XInclude, 286 xlink element, of, 648–649, 651, 657–658, 663, 875 xlink prefix, 649, 913 xlink:actuate attribute, 650–651, 655–657, 663, 674, 875 xlink:arc element, 665 xlink:arcrole attribute, 674 xlink:from attribute, 665–666, 667 xlink:href attribute Scalable Vector Graphics (SVG) operations using, 909, 913, 932 schema operations using, 875, 876 XLink operations using, 649, 650, 658 XPointer operations using, 680 xlink:label attribute, 665 xlink:role attribute, 652, 660 XLinks See also links; XPointer arcs, 661, 663–668, 674 attributes, matching in Extensible Stylesheet Language Transformations (XSLT), 508 browser override, 654–655 browser support, 648, 656 described, 14–15, 47 development, state of, 648 Document Type Definitions (DTDs), attribute declaration in, 650–652, 657, 660–661, 662, 668 extended links, 657–661 Hypertext Markup Language (HTML) links versus, 647–648, 671 images, embedding using, 875–878 link activation from non-XLink markup, 656 link activation inserts resource into existing document, 654 link activation on document load, 655 link activation on user request only, 655 link activation opens new window, 653–654 link activation references external markup, 654 link activation replaces current window, 653 linkbase, 669 linking elements, 648–649 links, out-of-line, 657, 669–674 links to parts of non-XML content, 669 locator elements, 658–660 namespace, 344, 649 QuickTime movies, linking to, 669 resources, local, 658 resources, remote, 658 role designations, 652, 660 schemas, XLink, 875, 876–878 specification, 648 target attributes, 649–650, 652 title designations, 652, 660 traversals, 663 xlink:show attribute, 651, 653–655, 761, 875 xlink:title attribute, 652, 660 xlink:to attribute, 665–667 XML Core Working Group, 1147–1148 XML declaration Channel Definition Format (CDF) files, 967 character set, 169 defined, 1102 Extensible HyperText Markup Language (XHTML) documents, in, 747 Hypertext Markup Language (HTML) documents, in, 170 not using, 146, 170 processing instruction, as, 158 Continued 1203 1204 Index ✦ X–X XML declaration (continued) Scalable Vector Graphics (SVG) documents, 886 specification, 1102–1103 standalone pseudo-attribute, 146, 266 version attribute, 58, 70 xsl:output attributes in, 564–567 XML Enabler, 488 xml files compressibility, 85–86, 253 loading, 57 naming, 56 saving, 56–57 XML Fragment Working Group, 678 XML Schema language, 830–831 XML well-formedness checker and validator, 223 XML Working Group, 1095, 1146–1147 XML-CML.ORG Web site, 19 XML-Data schema language, 830 xml:lang attribute described, 303–304 Extensible HyperText Markup Language (XHTML), in, 781 language identification Backus-Naur-Form (BNF) rules, 1054 schemas, in, 857 specifications relating to, 1107–1108 xmlns: attributes attribute value templates as value of, 535 prefix, 336, 691, 692 prefixless, 344, 347, 872 validation considerations, 349–350 xsl, 121 xmlns:fo attribute, 583 xmlns:xlink attribute, 651 xmlns:xsi attribute, 868 xml:space attribute, 301–303, 339, 558, 909, 1107 xml-stylesheet processing instruction basic use, 61, 158–159 href attribute, 61, 491, 561 Internet Explorer, provisions for handling media type, 119 Scalable Vector Graphics (SVG) documents, in, 886 type pseudo-attribute, 61, 119, 491 XPath arithmetic operations, 526–529 attribute value templates, as, 534 escapes, 524 introduced, 513 node set, 520–524 number, 526–529 result tree fragment, 529, 531 select attribute use of XPath language, 513 selection function, 513 selection of comment nodes, 517 selection of points in non-XML markup, 700–701 selection of processing instruction nodes, 517 selection of text nodes, 517 selection using boolean XPath expressions, 524–526 selection using hierarchy operators, 517–518 selection using node axes, 514–519 selection using node set expressions, 520–523 selection using node tests, 517 selection using number expressions, 526–529 selection using result tree fragment expressions, 529–531 selection using string expressions, 529–531 selection using wildcards, 517 specification (on the CD), 1027 string, 526, 529–531 syntax, abbreviated, 519 XPointer use of XPath syntax, 513 XPointer, working with, 700–701 Index ✦ X–X XPointer See also links; XLinks anchors compared, 679 browser support, 677 character encoding, 680–681 escapes, 680–681 introduced, 14–15 link iteration, 698–699 link referencing back to source document, 699 location paths, 684–685 location sets, 702 location steps, 684–685, 694 node sets, 694, 697–699 node tests, 684, 692–694 point specification in target document, 684–685 points, 700–701 predicates, 684, 694–696 ranges, working with, 701–704 selection counting down from root node, 686, 704 selection in non-XML markup, 700–701 selection of ancestor nodes, 689 selection of attribute nodes, 691 selection of child/grandchild nodes, 687–689, 704–705 selection of comment nodes, 693–694 selection of context nodes, 689 selection of element nodes, 692, 697–699 selection of namespace nodes, 691 selection of processing instruction nodes, 694 selection of sibling nodes, 687, 690–691 selection of text nodes, 693 selection using axes, 684, 686–691 selection using namespace prefixes, 692–693 selection using specified criteria, 694–696 singletons, 685 specification, 677 strings, working with, 702–704 Uniform Resource Identifiers (URIs), 680 white space, 701 wild cards, 684 XPath, working with, 700–701 XPath syntax, use of, 513 XPointer Last Call Working Draft, 677 xpointer() node test, 692 XSchema schema language, 830 xsd files, 832 xsd:all element, 848–850 xsd:annotation element, 879 xsd:anyType element, 867 xsd:anyURI element, 859, 869 xsd:appInfo element, 879 xsd:attribute element, 869–871, 876 xsd:boolean element, 859 xsd:byte element, 855 xsd:choice element, 848, 850–851 xsd:complexType element, 838, 844, 847, 850, 869 xsd:date element, 856 xsd:decimal element, 854 xsd:documentation element, 879 xsd:double element, 854 xsd:element element, 833, 838, 845–846, 850 xsd:ENTITIES element, 857 xsd:ENTITY element, 857 xsd:float element, 854 xsd:gMonth element, 856 xsd:gYear element, 856 xsd:ID element, 857 xsd:IDREF element, 857 xsd:IDREFS element, 857 xsd:import element, 877 xsd:int element, 855 xsd:integer element, 854 xsd:language element, 857 xsd:long element, 855 xsd:Name element, 858 xsd:NCName element, 858 xsd:negativeInteger element, 855 xsd:NMTOKEN element, 857 xsd:NMTOKENS element, 857 xsd:nonNegativeInteger element, 855 xsd:nonPositiveInteger element, 855 1205 1206 Index ✦ X–Z xsd:normalizedString element, 858 xsd:NOTATION element, 857 xsd:positiveInteger element, 855, 869 xsd:QName element, 858 xsd:recurringDate element, 856 xsd:recurringDay element, 856 xsd:restriction element, 865 xsd:schema element, 838, 874, 876, 879 xsd:sequence element, 848, 851 xsd:short element, 855 xsd:simpleType element, 865–867 xsd:string element, 833, 838, 858, 867 xsd:time element, 856 xsd:timeDuration element, 852, 856 xsd:timeInstant element, 856 xsd:token element, 859 xsd:unsignedByte element, 855 xsd:unsignedInt element, 855 xsd:unsignedLong element, 855 xsd:unsignedShort element, 855 xsi prefix, 835 xsi:noNamespaceSchemaLocation attribute, 834–835 xsi:schemaLocation attribute, 871, 876, 877 XSL See Extensible Stylesheet Language (XSL) xsl: elements, 486 xsl:apply-imports element, 561 xsl:apply-templates element described, 494–496 mode attribute, 552 select attribute, 499, 501, 506 xsl:apply-imports element compared, 561 xsl:attribute element, 533, 535, 536–537 xsl:attribute-set element, 537 xsl:call-template element, 556 xsl:choose element, 559–560 xsl:comment element, 509, 533, 539 xsl:copy element, 1020 xsl:copy-of element, 499, 540–542 xsl:element element, 533, 535–536 XSL-FO See Extensible Stylesheet Language Formatting Objects (XSL-FO) xsl:for-each element, 123, 125, 126, 499, 521 xsl:if element, 524, 559 xsl:import element, 560–561 xsl:include element, 561 xsl:key element, 521 xsl:number element, 542–548, 594, 623 xsl:otherwise element, 560 xsl:output element, 486, 563–567 xsl:param elements, 556–557 xsl:preserve-space element, 558 xsl:processing-instruction element, 509, 533, 535, 538–539 xsl:sort element, 499, 548–551 xsl:strip-space element, 558 xsl:stylesheet element, 118, 487, 561–562 XSLT See Extensible Stylesheet Language Transformations (XSLT) xsl:template element, 118, 486, 493–494, 499–500, 555 xsl:text element, 533, 539–540, 559 xsl:transform element, 487, 561 xsl:use-attribute-sets attribute, 537, 538 xsl:value-of element described, 120–121 node value computing, 497–498, 499 select attribute, 134–140, 496–497 variables, using with, 554 xsl:variable element, 553–554 xsl:when element, 559 XT XSLT Processor (on the CD), 1028 Y y attribute, 892, 907–908 y1 attribute, 896 y2 attribute, 896 Yi Unicode script block, 200 Z z-index property, 419, 951 Hungry Minds, Inc End-User License Agreement READ THIS You should carefully read these terms and conditions before opening the software packet(s) included with this book (“Book”) This is a license agreement (“Agreement”) between you and Hungry Minds, Inc (“HMI”) By opening the accompanying software packet(s), you acknowledge that you have read and accept the following terms and conditions If you not agree and not want to be bound by such terms and conditions, promptly return the Book and the unopened software packet(s) to the place you obtained them for a full refund License Grant HMI grants to you (either an individual or entity) a nonexclusive license to use one copy of the enclosed software program(s) (collectively, the “Software”) solely for your own personal or business purposes on a single computer (whether a standard computer or a workstation component of a multi-hyuser network) The Software is in use on a computer when it is loaded into temporary memory (RAM) or installed into permanent memory (hard disk, CD-ROM, or other storage device) HMI reserves all rights not expressly granted herein Ownership HMI is the owner of all right, title, and interest, including copyright, in and to the compilation of the Software recorded on the disk(s) or CD-ROM (“Software Media”) Copyright to the individual programs recorded on the Software Media is owned by the author or other authorized copyright owner of each program Ownership of the Software and all proprietary rights relating thereto remain with HMI and its licensers Restrictions On Use and Transfer (a) You may only (i) make one copy of the Software for backup or archival purposes, or (ii) transfer the Software to a single hard disk, provided that you keep the original for backup or archival purposes You may not (i) rent or lease the Software, (ii) copy or reproduce the Software through a LAN or other network system or through any computer subscriber system or bulletin-board system, or (iii) modify, adapt, or create derivative works based on the Software (b) You may not reverse engineer, decompile, or disassemble the Software You may transfer the Software and user documentation on a permanent basis, provided that the transferee agrees to accept the terms and conditions of this Agreement and you retain no copies If the Software is an update or has been updated, any transfer must include the most recent update and all prior versions Restrictions on Use of Individual Programs You must follow the individual requirements and restrictions detailed for each individual program in Appendix A of this Book These limitations are also contained in the individual license agreements recorded on the Software Media These limitations may include a requirement that after using the program for a specified period of time, the user must pay a registration fee or discontinue use By opening the Software packet(s), you will be agreeing to abide by the licenses and restrictions for these individual programs that are detailed in Appendix A and on the Software Media Except as expressly provided herein, none of the material on this Software Media or listed in this Book may ever be redistributed, in original or modified form, for commercial purposes Limited Warranty (a) HMI warrants that the Software and Software Media are free from defects in materials and workmanship under normal use for a period of sixty (60) days from the date of purchase of this Book If HMI receives notification within the warranty period of defects in materials or workmanship, HMI will replace the defective Software Media (b) HMI AND THE AUTHOR OF THE BOOK DISCLAIM ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE SOFTWARE, THE PROGRAMS, THE SOURCE CODE CONTAINED THEREIN, AND/OR THE TECHNIQUES DESCRIBED IN THIS BOOK HMI DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE SOFTWARE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE SOFTWARE WILL BE ERROR FREE (c) This limited warranty gives you specific legal rights, and you may have other rights that vary from jurisdiction to jurisdiction Remedies (a) HMI’s entire liability and your exclusive remedy for defects in materials and workmanship shall be limited to replacement of the Software Media, which may be returned to HMI with a copy of your receipt at the following address: Software Media Fulfillment Department, Attn.: XML Bible, Second Edition, Hungry Minds, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, or call 1-800-762-2974 Please allow four to six weeks for delivery This Limited Warranty is void if failure of the Software Media has resulted from accident, abuse, or misapplication Any replacement Software Media will be warranted for the remainder of the original warranty period or thirty (30) days, whichever is longer (b) In no event shall HMI or the author be liable for any damages whatsoever (including without limitation damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising from the use of or inability to use the Book or the Software, even if HMI has been advised of the possibility of such damages (c) Because some jurisdictions not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation or exclusion may not apply to you U.S Government Restricted Rights Use, duplication, or disclosure of the Software for or on behalf of the United States of America, its agencies and/or instrumentalities (the “U.S Government”) is subject to restrictions as stated in paragraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause of DFARS 252.227-7013, or subparagraphs (c) (1) and (2) of the Commercial Computer Software - Restricted Rights clause at FAR 52.227-19, and in similar clauses in the NASA FAR supplement, as applicable General This Agreement constitutes the entire understanding of the parties and revokes and supersedes all prior agreements, oral or written, between them and may not be modified or amended except in a writing signed by both parties hereto that specifically refers to this Agreement This Agreement shall take precedence over any other documents that may be in conflict herewith If any one or more provisions contained in this Agreement are held by any court or tribunal to be invalid, illegal, or otherwise unenforceable, each and every other provision shall remain in full force and effect CD-ROM Installation Instructions T he CD-ROM is divided into several directories that contain source code, examples, browsers, a PDF version of this book, and other tools and utilities To install the software and source code, mount the CD-ROM using whatever method you normally use on your platform, probably filemanager in Solaris, and just put it in the drive on Mac or Windows There isn’t a fancy installer You can browse the directories directly from the CD, or copy them onto your local drive The root directory contains an index.html file you can load into your Web browser of choice to provide a simple HTML interface for the CD-ROM ... it has absolutely exploded XML no longer needs to be justified as a good idea In fact, the question developers are asking has changed from “Why XML? ” to “Why not XML? ” XML has become the data... JavaBeans, XML: Extensible Markup Language, and Java I/O For Ma, a great grandmother Preface W elcome to the second edition of the XML Bible When the first edition was published about two years ago, XML. . .XML Bible Second Edition Praise for Elliotte Rusty Harold’s XML Bible “Great book! I have about 10 XML books and this is by far the best.” — Edward Blair, Systems Analyst,

Ngày đăng: 23/05/2018, 17:01