![[ Team Lib ] Learning XSLT Moves Smoothly from the Simple To](https://data.docslib.org/img/3a60ab92a6e30910dab9bd827208bcff-1.webp)
[ Team LiB ] • Table of Contents • Index • Reviews • Examples • Reader Reviews • Errata • Academic Learning XSLT By Michael Fitzgerald Publisher: O'Reilly Pub Date: November 2003 ISBN: 0-596-00327-7 Pages: 368 Learning XSLT moves smoothly from the simple to complex, illustrating all aspects of XSLT 1.0 through step-by-step examples that you'll practice as you work through the book. Thorough in its coverage of the language, the book makes few assumptions about what you may already know. You'll learn about XSLT's template-based syntax, how XSLT templates work with each other, and gain an understanding of XSLT variables. Learning XSLT also explains how the XML Path Language (XPath) is used by XSLT and provides a glimpse of what the future holds for XSLT 2.0 and XPath 2.0. [ Team LiB ] [ Team LiB ] • Table of Contents • Index • Reviews • Examples • Reader Reviews • Errata • Academic Learning XSLT By Michael Fitzgerald Publisher: O'Reilly Pub Date: November 2003 ISBN: 0-596-00327-7 Pages: 368 Copyright Preface Who Should Read This Book? About the Examples XSLT and XPath Reference How This Book Is Organized Conventions Used in This Book Using Examples Comments and Questions Acknowledgments Chapter 1. Transforming Documents with XSLT Section 1.1. How XSLT Works Section 1.2. Using Client-Side XSLT in a Browser Section 1.3. Using apply-templates Section 1.4. Summary Chapter 2. Building New Documents with XSLT Section 2.1. Outputting Text Section 2.2. Literal Result Elements Section 2.3. Using the Element Called element Section 2.4. Adding Attributes Section 2.5. Outputting Comments Section 2.6. Outputting Processing Instructions Section 2.7. One Final Example Section 2.8. Summary Chapter 3. Controlling Output Section 3.1. The Output Method Section 3.2. Outputting XML Section 3.3. Outputting HTML Section 3.4. Outputting Text Section 3.5. Using a QName Output Method Section 3.6. Media Types Section 3.7. Summary Chapter 4. Traversing the Tree Section 4.1. The XPath Data Model Section 4.2. Location Paths Section 4.3. Expressions Section 4.4. What Is a Pattern? Section 4.5. Predicates Section 4.6. Axes Section 4.7. Name and Node Tests Section 4.8. Doing the Math with Expressions Section 4.9. Summary Chapter 5. XPath and XSLT Functions Section 5.1. Boolean Functions Section 5.2. Node-Set Functions Section 5.3. Number Functions Section 5.4. String Functions Section 5.5. Summary Chapter 6. Copying Nodes Section 6.1. The copy Element Section 6.2. The copy-of Element Section 6.3. Copying Nodes from Two Documents Section 6.4. Summary Chapter 7. Using Variables and Parameters Section 7.1. Defining Variables and Parameters Section 7.2. Using Variables Section 7.3. Using Parameters Section 7.4. Invoking Templates with Parameters Section 7.5. Using Result Tree Fragments Section 7.6. Summary Chapter 8. Sorting Things Out Section 8.1. Simple Ascending Sort Section 8.2. Reversing the Sort Section 8.3. By the Numbers Section 8.4. Multiple Sorts Section 8.5. The lang and case-order Attributes Section 8.6. Summary Chapter 9. Numbering Lists Section 9.1. Numbered Lists Section 9.2. Alphabetical Lists Section 9.3. Roman Numerals Section 9.4. Inserting an Individual Formatted Value Section 9.5. Numbering Levels Section 9.6. The from Attribute Section 9.7. The lang and letter-value Attributes Section 9.8. More Help with Formatted Numbers Section 9.9. Summary Chapter 10. Templates Section 10.1. Template Priority Section 10.2. Calling a Named Template Section 10.3. Using Templates with Parameters Section 10.4. Modes Section 10.5. Built-in Template Rules Section 10.6. Summary Chapter 11. Using Keys Section 11.1. A Simple Key Section 11.2. More Than One Key Section 11.3. Using a Parameter with Keys Section 11.4. Cross-Referencing with Keys Section 11.5. Grouping with Keys Section 11.6. Summary Chapter 12. Conditional Processing Section 12.1. The if Element Section 12.2. The choose and when Elements Section 12.3. Summary Chapter 13. Working with Multiple Documents Section 13.1. Including Stylesheets Section 13.2. Importing Stylesheets Section 13.3. Using the document( ) Function Section 13.4. Summary Chapter 14. Alternative Stylesheets Section 14.1. A Literal Result Element Stylesheet Section 14.2. An Embedded Stylesheet Section 14.3. Aliasing a Namespace Section 14.4. Excluding Namespaces Section 14.5. Summary Chapter 15. Extensions Section 15.1. Xalan, Saxon, and EXSLT Extensions Section 15.2. Using a Saxon Extension Attribute Section 15.3. Result Tree Fragment to Node-Set Section 15.4. Using EXSLT Section 15.5. Fallback Behavior Section 15.6. Checking for Extension Availability Section 15.7. Summary Chapter 16. XSLT 2.0 and XPath 2.0 Section 16.1. New XSLT 2.0 Features Section 16.2. New XPath 2.0 Features Section 16.3. Multiple Result Trees Section 16.4. Using Regular Expressions Section 16.5. Grouping in XSLT 2.0 Section 16.6. Extension Functions Section 16.7. Summary Chapter 17. Writing an XSLT ProcessorInterface Section 17.1. Running an XSLT Processor from Java Section 17.2. Writing an XSLT Processor with C# Section 17.3. Summary Chapter 18. Parting Words Section 18.1. The Ox Documentation Tool Section 18.2. Signing Off Appendix A. XSLT Processors Section A.1. Installing and Running XSLT Processors Section A.2. Using jd.xslt Glossary Colophon Index [ Team LiB ] [ Team LiB ] Copyright Copyright © 2004 O'Reilly & Associates, Inc. Printed in the United States of America. Published by O'Reilly & Associates, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O'Reilly & Associates 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 [email protected]. Nutshell Handbook, the Nutshell Handbook logo, and the O'Reilly logo are registered trademarks of O'Reilly & Associates, 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 & Associates, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. The association between the image of a Marabou stork and the topic of XSLT is a trademark of O'Reilly & Asso ciates, Inc. 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. [ Team LiB ] [ Team LiB ] Preface Extensible Stylesheet Language Transformations (XSLT) and its companion, the XML Path Language (XPath), are arguably the two most widely used XML-related specifications to come out of the World Wide Web Consortium (W3C) since XML 1.0 (http://www.w3.org/TR/REC-xml.html). XSLT 1.0 (http://www.w3.org/TR/xslt) and XPath 1.0 (http://www.w3.org/TR/xpath) appeared as W3C recommendations in November 1999, about a year and a half after XML. While XSLT and XPath have detractors, they are generally well-accepted in the XML community. One reason why is that XSLT is a relatively easy-to-learn, declarative language. As a declarative language, XSLT relies on an underlying implementation in a programming language such as Java or C++ to get its work done. This book intends to get you doing useful work with XSLT the same day you start reading it. [ Team LiB ] [ Team LiB ] Who Should Read This Book? This book is for anyone who wants to get up to speed quickly with XSLT. It is designed around over 200 XML and XSLT examples files-nearly every XSLT feature that this book explores, in fact, is demonstrated by an example that you can run through yourself with the XSLT processor of your choice (Apache's Xalan C++ processor is used with most examples; see http://xml.apache.org). It doesn't matter if you're an XML neophyte or a seasoned programmer, this book is designed to help make your learning fast-paced and rewarding. [ Team LiB ] [ Team LiB ] About the Examples As a writer, I have labored for about 20 years under the assumption that we all learn best by doing. That's why this book is heavily laden with hands-on examples. All the examples in this book, except for an occasional fragment, are available for download from http://www.oreilly.com/catalog/learnxslt/. The examples are organized into directories that are associated with each of the chapters, as in examples/ch01, examples/ch02, examples/ch03, and so on. The XML documents and XSLT stylesheets used in the examples are intentionally simple so as to not obscure the principles they teach with too much distracting markup. These working examples will provide models for you to do about anything you can do with XSLT. [ Team LiB ] [ Team LiB ] XSLT and XPath Reference This book doesn't contain reference material for XSLT or XPath. Doug Tidwell'sXSLT (O'Reilly) does a good job with its reference material, and I recommend you get a copy of that book. The download for this book offers a small Java program called Ox that gives you access to reference information at the command prompt (in examples/Ox). For example, if you have a recent Java Runtime Environment (JRE) installed on you computer, you can enter a line such as the following at a command or shell prompt: java -jar ox.jar xsl:text Ox will then return information about the XSLT instruction element text on your screen.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages463 Page
-
File Size-