Skip to Content
XSLT Cookbook, 2nd Edition
book

XSLT Cookbook, 2nd Edition

by Sal Mangano
December 2005
Intermediate to advanced
774 pages
19h 30m
English
O'Reilly Media, Inc.
Content preview from XSLT Cookbook, 2nd Edition

Chapter 6. Exploiting XSLT 2.0

If the only new thing we have to offer is an improved version of the past, then today can only be inferior to yesterday. Hypnotized by images of the past, we risk losing all capacity for creative change.

Robert Hewison

Introduction

XSLT 2.0 has numerous additions and enhancements that make doing hard things in XSLT easier. This chapter will help the XSLT 1.0 veteran make the transition to 2.0 and also help the XSLT newbie understand how to better approach stylesheet design in 2.0.

XSLT 2.0 derives much of its improved functionality from XPath 2.0, so if you have skipped Chapter 1, then you should consider reading that first.

As with most progress in software technology, version 2.0 is an improved version of the old rather than a complete rethinking of stylesheet design. It also falls short in some features that could have made it a much better language (e.g., introspection and direct support for higher-order functions). However, XSLT 2.0 goes a long way toward elevating the drudgery of developing complex stylesheet logic. The key features in 2.0 are XPath functions, grouping, enhanced modes, cleaner idioms for reusable code, a richer type system, and enhanced support for text processing. All of these features are used to improve the 2.0 recipes that appear in this edition, but this chapter provides a one-stop reference for the new features themselves.

6.1. Convert Simple Named Templates to XSLT Functions

Problem

XSLT 1.0 did not support writing XPath functions ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

XSLT, 2nd Edition

XSLT, 2nd Edition

Doug Tidwell
XSLT Cookbook

XSLT Cookbook

Sal Mangano
Learning XSLT

Learning XSLT

Michael Fitzgerald
XSLT

XSLT

Doug Tidwell

Publisher Resources

ISBN: 0596009747Errata Page