XSLT Cookbook

XSLT Cookbook

3.69 (62 ratings by Goodreads)
By (author) 

List price: US$39.95

Currently unavailable

Add to wishlist

AbeBooks may have this title (opens in new window).

Try AbeBooks

Description

This 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. Recipes can be run directly or tweaked to fit your particular application's needs more precisely. Each recipe walks through a problem and a solution, with explanations of the choices made and techniques used in creating that solution, and many recipes include alternate solutions and explore issues like convenience and performance.
Topics covered include: string manipulation; mathematical processing; date and time handling; interactions between calendar systems; selecting content in source documents; efficient tree-manipulation; conversions from XML to plain text; tweaking XML documents with stylesheets; using XSLT to query XML documents; generating HTML with XSLT; creating charts and graphs with SVG and XSLT; generating C and XSLT code using XSLT; processing Visio documents in XSLT; working with XML Topic Maps (XTM); using XSLT to create SOAP documentation from WSDL; extending XSLT with additional functions; embedding XSLT in other processing; testing and debugging XSLT stylesheets; and creating generic XSLT processors which work on many XML vocabularies. The book is a companion both for developers still figuring out XSLT's template-based approach who want to learn by example, and for developers who know XSLT and want a collection of quickly reusable recipes. XSLT frequently offers a number of ways to perform a transformation, and the best solution may not always be the most straightforward.
The recipes in this Cookbook demonstrate and explain XSLT's template-based logic, a frequent stumbling block for developers new to XSLT. Among the variety of XSLT books now available, none has the explicit solution-oriented approach of this Cookbook.
show more

Product details

  • Paperback | 655 pages
  • 179 x 233 x 31.75mm | 930g
  • Sebastopol, United States
  • English
  • 0596003722
  • 9780596003722

Table of contents

Preface 1. Strings 1.1 Testing if a String Ends with Another String 1.2 Finding the Position of a Substring 1.3 Removing Specific Characters from a String 1.4 Finding Substrings from the End of a String 1.5 Duplicating a String N Times 1.6 Reversing a String 1.7 Replacing Text 1.8 Converting Case 1.9 Tokenizing a String 1.10 Making Do Without Regular Expressions 1.11 Using the EXSLT String Extensions 2. Numbers and Math 2.1 Formatting Numbers 2.2 Rounding Numbers to a Specified Precision 2.3 Converting from Roman Numerals to Numbers 2.4 Converting from One Base to Another 2.5 Implementing Common Math Functions 2.6 Computing Sums and Products 2.7 Finding Minimums and Maximums 2.8 Computing Statistical Functions 2.9 Computing Combinatorial Functions 2.10 Testing Bits 3. Dates and Times 3.1 Calculating the Day of the Week 3.2 Determining the Last Day of the Month 3.3 Getting Names for Days and Months 3.4 Calculating Julian and Absolute Day Numbers from a Specified Date 3.5 Calculating the Week Number for a Specified Date 3.6 Working with the Julian Calendar 3.7 Working with the ISO Calendar 3.8 Working with the Islamic Calendar 3.9 Working with the Hebrew Calendar 3.10 Formatting Dates and Times 3.11 Determining Secular and Religious Holidays 4. Selecting and Traversing 4.1 Optimizing Node Selections 4.2 Determining if Two Nodes Are the Same 4.3 Ignoring Duplicate Elements 4.4 Selecting All but a Specific Element 4.5 Performing a Preorder Traversal 4.6 Performing a Postorder Traversal 4.7 Performing an In-Order Traversal 4.8 Performing a Level-Order Traversal 4.9 Processing Nodes by Position 5. XML to Text 5.1 Dealing with Whitespace 5.2 Exporting XML to Delimited Data 5.3 Creating a Columnar Report 5.4 Displaying a Hierarchy 5.5 Numbering Textual Output 5.6 Wrapping Text to a Specified Width and Alignment 6. XML to XML 6.1 Converting Attributes to Elements 6.2 Converting Elements to Attributes 6.3 Renaming Elements or Attributes 6.4 Merging Documents with Identical Schema 6.5 Merging Documents with Unlike Schema 6.6 Splitting Documents 6.7 Flattening an XML Hierarchy 6.8 Deepening an XML Hierarchy 6.9 Reorganizing an XML Hierarchy 7. Querying XML 7.1 Performing Set Operations on Node Sets 7.2 Performing Set Operations on Node Sets Using Value Semantics 7.3 Determining Set Equality by Value 7.4 Performing Structure-Preserving Queries 7.5 Joins 7.6 Implementing the W3C XML Query-Use Cases in XSLT 8. XML to HTML 8.1 Using XSLT as a Styling Language 8.2 Creating Hyperlinked Documents 8.3 Creating HTML Tables 8.4 Creating Frames 8.5 Creating Data-Driven Stylesheets 8.6 Creating a Self-Contained HTML Transformation 8.7 Populating a Form 9. XML to SVG 9.1 Transforming an Existing Boilerplate SVG 9.2 Creating Reusable SVG Generation Utilities for Graphs and Charts 9.3 Creating a Tree Diagram 9.4 Creating Interactive SVG-Enabled Web Pages 10. Code Generation 10.1 Generating Constant Definitions 10.2 Generating Switching Code 10.3 Generating Message-Handling Stub Code 10.4 Generating Data Wrappers 10.5 Generating Pretty Printers 10.6 Generating a Test Data-Entry Web Client 10.7 Generating Test-Entry Web CGI 10.8 Generating Code from UML Models via XMI 10.9 Generating XSLT from XSLT 11. Vertical XSLT Application Recipes 11.1 Converting Visio VDX Documents to SVG 11.2 Working with Excel XML Spreadsheets 11.3 Generating XTM Topic Maps from UML Models via XMI 11.4 Generating Web Sites from XTM Topic Maps 11.5 Serving SOAP Documentation from WSDL 12. Extending and Embedding XSLT 12.1 Using Saxon's and Xalan's Native Extensions 12.2 Extending XSLT with JavaScript 12.3 Adding Extension Functions Using Java 12.4 Adding Extension Elements Using Java 12.5 Using XSLT from Perl 12.6 Using XSLT from Java 13. Testing and Debugging 13.1 Using xsl:message Effectively 13.2 Tracing the Flow of Your Stylesheet Through Its Input Document 13.3 Automating the Insertion of Debug Output 13.4 Including Embedded Unit Test Data in Utility Stylesheets 13.5 Structuring Unit Tests 13.6 Testing Boundary and Error Conditions 14. Generic and Functional Programming 14.1 Creating Polymorphic XSLT 14.2 Creating Generic Element Aggregation Functions 14.3 Creating Generic Bounded Aggregation Functions 14.4 Creating Generic Mapping Functions 14.5 Creating Generic Node-Set Generators Index
show more

Review quote

"...this book is a powerful reference work. The problems tackled are well chosen, the solutions elegant and the explanations carefully and clearly explained." - Rick Stones, Cvu, August 2003
show more

About 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 this book. Sal has a master's degree in computer science from Polytechnic University.
show more

Rating details

62 ratings
3.69 out of 5 stars
5 21% (13)
4 35% (22)
3 37% (23)
2 5% (3)
1 2% (1)
Book ratings by Goodreads
Goodreads is the world's largest site for readers with over 50 million reviews. We're featuring millions of their reader ratings on our book pages to help you find your new favourite book. Close X