What’s New in the Third Edition
The French philosopher and mathematician Blaise Pascal once wrote in a letter, “I have only made this longer because I have not had the time to make it shorter.” I know how he felt. The first edition of the XML Bible was written under great time pressure, was finished well after deadline, and totaled more than 1000 pages, the largest book I had written up to that point. My favorite reader comment about that 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 do it without breaking into a sweat.” While I probably could write 10,000 words about blue, for the third edition, I did try to restrain myself and take the time to write more concisely. I rewrote the book from the ground up; and while I retained the basic flavor and outline that proved so popular with the first edition, I tightened up the writing and cut many examples down to size. With the benefit of five years of hindsight, I have also been able to expand coverage of promising new technologies (schemas, XInclude, XHTML, SVG, XML Base, and RDDL) while eliminating coverage of applications that proved to be less useful than they initially appeared (WML, VML, CDF, HTML+TIME, RDF, and so on). The result is a more concise, approachable volume that covers more of what you need to know and less of what you don’t. If you liked the first or second edition, you’re going to like the third edition even more. I’m confident you’ll find this an even more useful tutorial and reference.
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. 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 do the following:
♦ Write a basic HTML page, including links, images, and text, using a text editor.
♦ Place that page on a web server.
On the other hand, I do 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 do a little. As you learn a little more, you can do 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 the following:
♦ 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 write with international characters such as H£ and Æ
♦ How to validate documents against DTDs and schemas
♦ How to build large documents from smaller parts using entities and XInclude
♦ 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
In the final part of this book, you’ll see several practical examples of XML being used for real-world applications, including the following:
♦ Web site design
♦ Schemas
♦ Vector graphics
♦ Genealogy
How the Book Is Organized
This book is divided into five parts:
I. Introducing XML II. Document Type Definitions
III. Style Languages
IV. Supplemental Technologies V. XML Applications
By the time you finish reading this book, you’ll be ready to use XML to create compelling web pages.
Part I: Introducing XML
Part I (Chapters 1 through 6) begins with the history and theory behind XML and the goals XML is trying to achieve. It shows you how the different pieces of the XML equation fit together to enable you to create and deliver documents to readers. You’ll see several compelling examples of XML applications to give you some idea of the wide applicability of XML, including Scalable Vector Graphics (SVG), the Open Financial Exchange (OFX), the Mathematical Markup Language (MathML), the Extensible Forms Description Language (XFDL), and many others. Then you’ll learn by example how to write XML documents with tags that you define that make sense for your document. You’ll learn how to edit them in a text editor, attach style sheets to them, and load them into a web browser such as Internet Explorer 5.0 or Mozilla.
Part II: Document Type Definitions
Part II (Chapters 7 through 11) focuses on document type definitions (DTDs). A DTD specifies which elements are and are not allowed in an XML document, and the exact context and structure of those elements. A validating parser can read a document, compare it to its DTD, and report any mistakes it finds. DTDs enable document authors to ensure that their work meets any necessary criteria.
In Part II, you’ll learn how to attach a DTD to a document, how to validate your documents against their DTDs, and how to write new DTDs that solve your own problems. You’ll learn the syntax for declaring elements, attributes, entities, and notations. You’ll learn how to use entity declarations and entity references to build both a document and its DTD from multiple, independent pieces. This allows you to make long, hard-to-follow documents much simpler by separating them into related modules and components. And you’ll learn how to use namespaces to mix together different XML vocabularies in one document.
Part III: Style Languages
Part III (Chapters 12 through 16) teaches you everything you need to know about style sheets. XML markup only specifies what’s in a document. Unlike HTML, it does not say anything about what that content should look like. Instead, style shheets provide all necessary information about an XML document’s appearance when printed, viewed in a web browser, or otherwise displayed. Different style sheets can be applied to the same document. You might, for example, want to use one style sheet that specifies small fonts for printing, another one with larger fonts for onscreen presentation, and a third with absolutely humongous fonts to project the document on a wall at a seminar. You can change the appearance of an XML document by choosing a different style sheet without touching the document itself.
Part III describes in detail the two style sheet languages in broadest use today, Cascading Style Sheets (CSS) and the Extensible Stylesheet Language (XSL). CSS is a simple style sheet language originally designed for use with HTML. It applies fixed style rules to the contents of particular elements.
XSL, by contrast, is a more complicated and more powerful style language that can apply styles to the contents of elements, as well as rearrange elements, add boilerplate text, and transform documents in almost arbitrary ways. XSL is divided into two parts: a transformation language for converting XML trees to alternative trees, and a formatting language for specifying the appearance of the elements of an XML tree.
Part IV: Supplemental Technologies
Part IV (Chapters 17 through 20) introduces some XML-based languages and syntaxes that layer on top of basic XML to provide additional functionality and features. XLink provides multidirectional hypertext links that are far more powerful than the simple HTML tag. XPointers introduce a new syntax you can attach to the end of URLs to link not only to particular documents but also to particular parts of particular documents. XInclude enables you to build large XML documents out of multiple smaller XML documents. XML Schemas provide a more complete validations language that includes data typing and range checking. All of these can be added to your own XML-based markup languages to extend their power and utility.
Part V: XML Applications
Part V (Chapters 21 to 25) demonstrates several practical uses of XML in different domains. XHTML is a reformulation of HTML 4.0 as valid XML. RDDL is an XHTML-and XLink-based language for documents containing meta-information placed at the end of namespace URLs. Scalable Vector Graphics (SVG) is a standard XML format for drawings recommended by the World Wide Web Consortium (W3C). Finally, a completely new application is developed for genealogical data to show you not just how to use XML tags and technologies, but why and when to choose them. Combining all of these different applications, you’ll develop a good sense of how XML applications are designed, built, and used in the real world.
What You Need
XML is a platform-independent technology. You’ll notice that screen shots in this book have been captured from Windows, Mac OS 9, Mac OS X, and Linux. Almost all the examples work equally well across all common platforms. You will need a web browser that supports XML, such as Mozilla, Netscape 6.0 or later, or Internet Explorer 6.0.
Furthermore, much of the best software for working with XML is written in Java and can run on multiple platforms. Much of this is freely available on the Internet. You will need a Java 1.2 or later virtual machine. (Java 1.1 can do in a pinch.) You won’t need to write any programs to use this book. You’ll just need it to run programs written in Java.
How to Use This Book
This book is designed to be read more or less cover to cover. Each chapter builds on the material in the previous chapters in a fairly predictable fashion. Of course, you’re always welcome to skim over material that’s already familiar to you. I also hope you’ll stop along the way to try out some of the examples and to write some XML documents of your own. It’s important to learn not just by reading, but also by doing. Before you get started, I’d like to make a couple of notes about grammatical conventions used in this book.
Unlike HTML, XML is case-sensitive.
Read Comments To Download
1 comments:
http://rapidshare.com/files/98634828/XML_1.1_Bible__3rd_Edition_2004.pdf
or
http://tinyurl.com/2amjqx
Post a Comment