Chapter 8

Variables in XSLT: A Breed Apart

In This Chapter

bullet Declaring variables

bullet Setting variables in templates

bullet Using variables to save time

bullet Calculating values with variables

bullet Determining variable scope

D o you like canned spinach? Unless you have a name that begins with a P, forearms the size of thighs, and a girlfriend named Olive Oyl, I suspect you’d much prefer a fresh spinach salad instead. Okay, maybe spinach is pushing it, but I bet you’d at least go for the fresh part, right? Prepackaged goods are helpful when you need to prepare food in advance of their actual use, but people don’t much like the notion of “canned” anything if they can help it.

In earlier chapters of this book, I walk you through a lot of XSLT. All the information plugged into result documents until this chapter has come from XML or from “canned” text. That works fine in the earlier chapters of this book, but just as one longs for fresh veggies after a weekend camping trip of SPAM and beef jerky, here I show ...

Get XSLT for Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.