作者:empty 页数:289 出版社:empty |
Visual Quick Star Guide is a trade maka f Peachpit, a divi on of Pearson Education.Many of the des ag nations used by manufacturers and sellers to distinguish their products a red aimedas trademarks.Where those designations appear in this ba ok, and Peach pir was aware of a trademarkel aim, the designations appear as requested by the owner of the trademark.All other produc r namesand services identifed throughout this book are used in editorial fashion an ly and for the benefit ofsuch companies with no intention of infringement of the trademark.No such use, or the use of anytradename, is intended to convey endorsement or other affiliation with this book.ISBN-13:978-0-321-55967-8ISBN-10:0-321-55967-398765431T
Printed and bound in the United States of AmericaXML has come along way since I wrote the first edition of this book in 2001.It is aswide spteadnowasitwascxotic thenLast year, I bumped into my friend Kevin Goldberg on a visit to Calfornia.We hadknown eachother inc allege.and had played alot of Bag gle together in BarcelonaWhen he offered to help me revise this book, I jumped ar the chance.Kevin has beenworking in the computer industry for more than twenty y cars.He started his career as avideo gameprogrammer and producer.Since 1997.Kevin has been serving as partner andchief technology officer at in ag istic, an award winning, Web development and servicescamp any in Southern California.In this role, he is regularly called upon to help clientsclarify their business needs, and to clearly communicate the nature and appic ablity ofpatent i al technology solutions-in a sense.demystify technology.Besides all of these apt credentials, Kevin is a great guy, He is smart, conscientious, cre-ative, and—not to mention careful with deta is.In addition to updating the contentand examples in the book, he added chapters on XSL-FO, recent W3C recommendations(XSLT 2.0, XPath 2.D and XQuery 1.0) , and a chapter devoted io real world examplescalled XML iu Practice.I am most confident that you will find this second edition ofXMI:Vi ual QuickStart Guide to bean excellent tutorial for learning al labour XML.
Elizabeth CastroAuthor of XML fort le WorldWide Web Vii ual Quick Starr GuideKevin Howard Goldberg has been working with computers since 1976whenhefaught himself BASIC on his elementary schools PDP 11/70.Since then, Kevins careerhas included management consulting using commerce simulations, and lead softwaredevelopment for numerous videogame titles in multi-million dollar divisions at FilmRoman and Lionsgate(previously Trimark) .In his current capacity, he runs technologyWestlake Vilage, California.Kevin serves on the Santa Monica College Computer Science and Information SystemsAdvisory Board, and was invited to speak at the ACLU Nationwide Staff Conference as aWeb development and production expert.Kevin holds a bachelors degree in Economies and Entrepreneur al Management from theWharton School of Business at the University of Pennsylvania, and is a candidate for amasters degree in Computer Science at the University of California, LosAngeles.FOREWORD BY ELIZABETH CASTROABOUT THE AUTHOR
DEDICATIONTHANKYouThis book is ded cated to my wfc, La in ic; in exchange for hart aed weekends, nigh-timesur to gates, and an overcrowded bed to om, shc iccc ives this book I am truly blessedMichael Weiss, my business partner(of more than eleven years) , my brother-in-lawand my friend.His support throughout this process; uncanny ability to see things from areaders perspective, and willingness to do what it took to get the job done, while I was, attimes, preoccupied, was invaluable to me.Chris Hare.my technical editor, for jumping into the XML deep end and amazinglykeeping everything else afloat; teaching me the xu bt let ies of punctuation(colons, semi-colons, and parenthetical expressions, oh my!:and being so detailed that when a pagecame back with less than a dozen red mat ks.I was concerned.The staff at imagistic(Chris Heidi.Rob ent, Sam, Tr mara, and Wl, who didnt knowwhat was coming, but nonetheless kept all the plates spinning with grace and humorDavid VanNess, Peachpit s production editor extraordinaire, who was so incrediblyhelpful, resourceful, accommodating.available, and patientNancy Davis, editor-in-chief at Peach pi, for seeing all the possibilities and shepherd-ing this complex process through to completion.Finally, avery spee i al thanks to Elizabeth Castro, whose openness, honesty, into grit y,and furst edition of ths book made this sc cond edition poss ble.IMAGE COPYRIGHTS·Herodotus head in the Stoa of Attalus, Athens(In v.S 270) .photograph by SamuelProvost.·Depictions of The Seven Wonders of the Ancient World.as painted by16th-century Dutchartist Marten Jacob zoon Heemskerk van Veen, reside within the public domain.
TABLE OFCONTENTS
Chapter 1:
Chapter 2:
Introduction.
What is XML?
The Power of XML..
Extending XML..
XML in Practice..
About This Book..
What This Book is No to
Part1:XML
Wri ing XML..
An XML Sample..
Rules for Wrt ing XML
Elements, Attributes, and Values.
HowTo Begin, .
Creat ng the RootElement.
Writing Child Elements.
Nesting Elements..
Adding Attributes.
Using Empty Elements.-
Writing Comments.p
Pre deine dEnt tis-Five Special Symbol.
Displaying Elements as Text.
Part2:XSL
XSLT.
ansfngXMLwihXSir
Beginning an XSLT StyleSheet,
Creating the Root Template.
Out pur ting HTML..
Out puc ting Values.
Looping Over Nodes.
Processing Nodes Conditionally..
Evalua ion Warning:The document was created wth Spire.PDF for.NET.
.TableofContents
Chapter 3:
Chap ler 4:
Chapter 5:
Chapter 6:
Chapter 7:
Chapter 8:
Chapter 9:
Adding Conditional Choices.
Sorting Nodes Before Processing.
Generating Output Attributes.
Creating and Applying Templates
XPath Patterns and Expressions..
Locating Nodes.
Deter n in ing the CurrentNode
Referring to the CurrentNode.
Selecting aNode's Children..
Select nga Nodes Parent or Siblings.
Selecting aNode'sAt tribu res.-.
Conditionally Selecting Nodes..
Crea in gA bsp lute Location Paths-
Selecting All the Descendants.
XPath Functions.
Comparing Two Values-..
Testing the Position.
Multiplying, Dividing, Adding.Subtracting-
Counting Nodes.
Formatting Numbers.
Rounding Numbers.
Extracting Substrings.
Changing the Case of a String-
Total ng Values.
More XPath Functions.
XSL FO..
The Two Parts of an XSL FO Document..
Creating an XSL-FO Document.--..
Creating and S tying Blocks of Page Content.
Adding Images..o.oa
Den iga Page Template.
Creating a Page Tern plate Header
Using XSLT to Create XSL-FO.
Inserting Page Breaks.-..
Our put ng Page Content in Calum ns.
Adding a New Page Template..
Part3:DTD
Creating a DTD.
Working wih DTDs..
Dehn ngan Element That Contains Text
Defining an Empty Element . 78
Deh in ingan Element That Contains a Chid, .
Defining an Element That Contains Children,
Dehn ing How Many Occurrence 5.
Defining Choices..
Defining an Element Thar Cons Any th
About Attributes..
Def nig An but es:
DehningDefaulr Values..
Def ning Art i but es with Choices., .
Dening AttrbuteswihUniqueVlues.
Referencing Attributes with Unique Values.
Restricting Atti but es to Valid XML Names..
Entities and Notations in DTDs..
Creating a General Entity.-
Using General Entities..
Creat gan External GeneralE nity..
Using External General Entities.
Creating Enti ies for Unparsed Content..
Embedding Unparsed Content.
Cra tig and Using Pa a meter Ent ties
Creating an External Parameter Entity.
Validation and Using DTDs.
Creating an External DTD..
Deel a ring an External DTD..·+-
Del arng and Creating an Inte mal DTD.
Vaida ingXMLDaeumensAnstaDTD.
Naming a Public External DTD..
Deel a ring a Public External DTD.
Pros and Cons of DTDs..
Part4:XMLSchema
XMLSchema Basics..
Working with XMLSchema.
Begining a Simple XMLSchema..
Assoc at ngan XMLSchema wih an XMLDocument . 117
Annotating Schemas..
De in in ga SimpleType Element.
Using DateandTime Types..
Using Number Types..
Pre de in ingan Elemen rs Content.
De rving Custom Simple Types..126
To ble of Canton ts
Eva i uation Warning:The document was created with Spire.PDF for.NET.
TableofContents
Deriving Named Custom Types.
Spe ifying a Range of Accep rable Values
Specifying a Set of Acceptable Values.
Limiting the Length of an Element.
Specifying a Pattern for an Element.
Limiting a Numbers Digits.
Deriving a List Type.
Deriving a Union Type
ComplexType Basics.
Dering Anonymous Complex Types.
Deriving Named Complex Types---
Chapter11:DefiningComplexTypes.
Chapter12:XMLNamespaces.
Chapter13:UsingXMLNamespaces.
Chapter14:XSLT2.0..
Chapter15:XPath2.0..
Chaper16:XQuery1.0.
De ing ComplexType Th arCona inCh id Elemen ss 142
Requiring Child Elements to Appear in Sequence-.143
Al wing Chid Elements to Appear in Any Order-.144
Creating a Set of Choices..145
De in in gEe ments to Conta nO aly Text.146
De in ing Empty Elements.147
De higEementswihMiedContene.148
De rving Compex Types from Ex isig Complex Typ.149
Referencing Globally De lined Elements-.150
Controlling How Many-..151
Dehn ng Named Model Groups..152
Referencing a Named Model Group·.153
Defining Attributes.154
Requiring an Attribute..155
Pre dehn in ganA tributes Com tnt..156
Defining Attribute Groups..157
Referencing Attribute Groups.158
Local and Global Deli nitions..159
Part5:Namespaces
Designing a Namespace Name.164
Declaring a Default Namespace.165
Dec larga Namespace Name Pre x.166
Label ng Elements wth a Namespace Pre fx. 167
How Namespaces Affect Attributes.168
Po puting an XML Namespace.
XML Schemas, XML Documents, and Namespace 5.. 171
Referen ng XMLSchema Components in Namespaces . 172
Namespaces and Validating XML.
Adding All Local y De in ed Elements
Adding Particular Locally Defined Elements
XMLSchema sin Mul rip le Files..
XMLSchema sw th Multiple Namespaces
The Schema of Schemas as the Default.
Namespaces and DTDs.
XSLT and Namespaces
Part6:RecentW3CRecommendations
Extend ng XSLT
Crean ga Simpli fed StyleSheet..
Gen craig XHTML Our pur Documents
Generating MuIr ip le Output Documents.
Creating User De in ed Functions.
Calling User Defined Functions.
GoupngOupurUing Common values
Validating XSLT Out pur..
XPath 1.0 and XPath 2.0.
Averaging Values in a Sequence
Fi ding theM ii num or Maximum Valu
Formatting Strings..
Testing Conditions..
Quantifying a Condi ion.
Removing Duplicate Items.
Looping Over Sequences.
Using Today's DateandTime
Writing Comments.
Proc eng Non-XML Input.
x Quer 1.05.XSLT 2.0..
Compo ingan XQuery Document..
l denti fig an XML Source Document..
Uing Path Expressions.
Wit ing FLW OR Expressions..
Testing wih Conditional Expressions.
Joining Two Related DataSources.
Crain g and Can g User Dehne d Func in 5..
XQuery and Databases..
km..
nep ice oZ p
m..
To ble of Contents
Part7:XMLinPractice
Ajax Basics..
Ajax Examples..
RSS Basics.
RSS Schema.
Extending RSS.4.
SOAP and WebServices.
SOAP Message Schema.
WSDL.
KML Basics..
AS imp lKML Fle.
ODF and OO XML,
c Books, ePub, and More
Tools for XML in Practice,
Appendices
XML Editors.
Add tonal XML Editors
XML Tools and Resources..
Specifying the Character Encoding-
Using Numeri e Character References
Using Entity References-..
Unicode Characters.
Index.
Chapter17:Ajax, RSS, SOAP, and More.
Appendix A:XML Tools..
Appendix B:Character Sets and En i ies.
INTRODUCTION