Buying Options
XSLT Cookbook
Safari Books Online
Add to Cart
What is this?

Product Editions

Please consider the latest edition.

  1. XSLT Cookbook, Second Edition - December 2005
  2. XSLT Cookbook - December 2002
Description
The XSLT Cookbook is a collection of hundreds of solutions to problems that Extensible Stylesheet Language Transformations (XSLT) developers regularly face. The recipes range from simple string-manipulation and mathematical processing to more complex topics like extending XSLT, testing and debugging XSLT stylesheets, and graphics creation with SVG. Among the variety of XSLT books now available, none has the explicit solution-oriented approach of this Cookbook.
Full Description
Table of Contents
  1. Chapter 1 Strings

    1. Testing if a String Ends with Another String

    2. Finding the Position of a Substring

    3. Removing Specific Characters from a String

    4. Finding Substrings from the End of a String

    5. Duplicating a String N Times

    6. Reversing a String

    7. Replacing Text

    8. Converting Case

    9. Tokenizing a String

    10. Making Do Without Regular Expressions

    11. Using the EXSLT String Extensions

  2. Chapter 2 Numbers and Math

    1. Formatting Numbers

    2. Rounding Numbers to a Specified Precision

    3. Converting from Roman Numerals to Numbers

    4. Converting from One Base to Another

    5. Implementing Common Math Functions

    6. Computing Sums and Products

    7. Finding Minimums and Maximums

    8. Computing Statistical Functions

    9. Computing Combinatorial Functions

    10. Testing Bits

  3. Chapter 3 Dates and Times

    1. Introduction

    2. Calculating the Day of the Week

    3. Determining the Last Day of the Month

    4. Getting Names for Days and Months

    5. Calculating Julian and Absolute Day Numbers from a Specified Date

    6. Calculating the Week Number for a Specified Date

    7. Working with the Julian Calendar

    8. Working with the ISO Calendar

    9. Working with the Islamic Calendar

    10. Working with the Hebrew Calendar

    11. Formatting Dates and Times

    12. Determining Secular and Religious Holidays

  4. Chapter 4 Selecting and Traversing

    1. Optimizing Node Selections

    2. Determining if Two Nodes Are the Same

    3. Ignoring Duplicate Elements

    4. Selecting All but a Specific Element

    5. Performing a Preorder Traversal

    6. Performing a Postorder Traversal

    7. Performing an In-Order Traversal

    8. Performing a Level-Order Traversal

    9. Processing Nodes by Position

  5. Chapter 5 XML to Text

    1. Dealing with Whitespace

    2. Exporting XML to Delimited Data

    3. Creating a Columnar Report

    4. Displaying a Hierarchy

    5. Numbering Textual Output

    6. Wrapping Text to a Specified Width and Alignment

  6. Chapter 6 XML to XML

    1. Converting Attributes to Elements

    2. Converting Elements to Attributes

    3. Renaming Elements or Attributes

    4. Merging Documents with Identical Schema

    5. Merging Documents with Unlike Schema

    6. Splitting Documents

    7. Flattening an XML Hierarchy

    8. Deepening an XML Hierarchy

    9. Reorganizing an XML Hierarchy

  7. Chapter 7 Querying XML

    1. Performing Set Operations on Node Sets

    2. Performing Set Operations on Node Sets Using Value Semantics

    3. Determining Set Equality by Value

    4. Performing Structure-Preserving Queries

    5. Joins

    6. Implementing the W3C XML Query-Use Cases in XSLT

  8. Chapter 8 XML to HTML

    1. Using XSLT as a Styling Language

    2. Creating Hyperlinked Documents

    3. Creating HTML Tables

    4. Creating Frames

    5. Creating Data-Driven Stylesheets

    6. Creating a Self-Contained HTML Transformation

    7. Populating a Form

  9. Chapter 9 XML to SVG

    1. Transforming an Existing Boilerplate SVG

    2. Creating Reusable SVG Generation Utilities for Graphs and Charts

    3. Creating a Tree Diagram

    4. Creating Interactive SVG-Enabled Web Pages

  10. Chapter 10 Code Generation

    1. Generating Constant Definitions

    2. Generating Switching Code

    3. Generating Message-Handling Stub Code

    4. Generating Data Wrappers

    5. Generating Pretty Printers

    6. Generating a Test Data-Entry Web Client

    7. Generating Test-Entry Web CGI

    8. Generating Code from UML Models via XMI

    9. Generating XSLT from XSLT

  11. Chapter 11 Vertical XSLT Application Recipes

    1. Converting Visio VDX Documents to SVG

    2. Working with Excel XML Spreadsheets

    3. Generating XTM Topic Maps from UML Models via XMI

    4. Generating Web Sites from XTM Topic Maps

    5. Serving SOAP Documentation from WSDL

  12. Chapter 12 Extending and Embedding XSLT

    1. Saxon Extension Functions

    2. Saxon Extension Elements

    3. Xalan Java 2 Extension Functions

    4. Java Extension Function Using the Class Format Namespace

    5. Java Extension Function Using the Package Format Namespace

    6. Java Extension Function Using the Java Format Namespace

    7. Scripting Extension Function Using Inline Script Code

    8. Xalan Java 2 Extension Elements

    9. Java Extension Element

    10. Scripting Extension Elements

    11. MSXML Extension Functions

    12. Using Saxon's and Xalan's Native Extensions

    13. Extending XSLT with JavaScript

    14. Adding Extension Functions Using Java

    15. Adding Extension Elements Using Java

    16. Using XSLT from Perl

    17. Using XSLT from Java

  13. Chapter 13 Testing and Debugging

    1. Using xsl:message Effectively

    2. Tracing the Flow of Your Stylesheet Through Its Input Document

    3. Automating the Insertion of Debug Output

    4. Including Embedded Unit Test Data in Utility Stylesheets

    5. Structuring Unit Tests

    6. Testing Boundary and Error Conditions

  14. Chapter 14 Generic and Functional Programming

    1. Introduction

    2. Creating Polymorphic XSLT

    3. Creating Generic Element Aggregation Functions

    4. Creating Generic Bounded Aggregation Functions

    5. Creating Generic Mapping Functions

    6. Creating Generic Node-Set Generators

  1. Colophon

View Full Table of Contents
Product Details
Title:
XSLT Cookbook
By:
Sal Mangano
Publisher:
O'Reilly Media
Formats:
  • Print
  • Safari Books Online
Print Release:
December 2002
Pages:
672
Print ISBN:
978-0-596-00372-2
| ISBN 10:
0-596-00372-2
Customer Reviews
About the Author
  1. Sal Mangano

    Sal Mangano has been developing software for over 12 years and has worked on many mission-critical applications, especially in the area of financial-trading applications. Unlike many XML/XSLT developers, he did not approach the technology from the standpoint of the Internet and Web development but rather from the broader need for a general-purpose, data-transformation framework. This experience has given him a unique perspective that has influenced many of the recipes in his book, the XSLT Cookbook. Sal has a Master's degree in Computer Science from Polytechnic University.

    View Sal Mangano's full profile page.

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 animals on the cover of XSLT Cookbook are red mullet fish. These colorful striped fish are native to warm European seas. They are bottom dwellers who feed on small invertebrates such as crustaceans, worms, and mollusks, along with the occasional small fish. Red mullet are also called goatfish, as they have two flexible whisker-like appendages that hang from their chin. These organs, called barbels, are covered with taste buds to help red mullet locate their food and dig into ocean sand. The fish usually weigh one-half to two pounds and can grow as long as two feet, but most are much smaller. They have a deeply forked tail fin, two dorsal fins, and corresponding pectoral and anal fins. Red mullet are indeed pink to bright red in color, with three or four yellow stripes running lengthwise along their side. Considerable changes in color occur depending on the time of day, stress factors, and age.

Seafood chefs have always prized the red mullet for its firm, lean flesh, subtle flavor, and intense color. The fish is found on menus throughout Europe, but is rarely available in the United States. Red mullet is sometimes called the woodcock of the sea because, like the woodcock, it can be eaten with its innards intact. There are around forty known subspecies, but two types are most popular for food: Mullus surmuletus is commonly found in the Atlantic, around the south coast of Britain, and Mullus barbatus is a more delicate Mediterranean variety. The latter fish was a favorite of ancient Romans, who proudly displayed live red mullet on the dinner table immediately before handing them over to the cook. Stock was kept in large lagoons, and zealous gourmands paid fabulous prices for any specimen above average size. Jeffrey Holcomb was the production editor and proofreader for XSLT Cookbook. Ann Schirmer was the copyeditor. Matt Hutchinson and Claire Cloutier provided quality control. Indexing services were provided by Octal Publishing.

Ellie Volckhausen designed the cover of this book, based on a series design by Edie Freedman. The cover image is a 19th-century engraving from the Dover Pictorial Archive. Emma Colby produced the cover layout with QuarkXPress 4.1 using Adobe's ITC Garamond font.

David Futato designed the interior layout. This book was converted 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 Lucas-Font's TheSans Mono Condensed. The illustrations that appear in the book were produced by Robert Romano and Jessamyn Read using Macromedia FreeHand 9 and Adobe Photoshop 6. The tip and warning icons were drawn by Christopher Bing. This colophon was written by Philip Dangler.

  • Book cover of XSLT Cookbook