Skip to Content
XSLT Cookbook, 2nd Edition
book

XSLT Cookbook, 2nd Edition

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

Chapter 15. Testing and Debugging

Frequently, crashes are followed with a message like “ID 02.” “ID” is an abbreviation for idiosyncrasy and the number that follows indicates how many more months of testing the product should have had.

Guy Kawasaki

Introduction

Many XSLT scripts you write will be so-called one-offs that transform well-defined input. Here testing does little more than execute the transformation against the input and inspect the output. However, even in this simple case, how do you best deal with a stylesheet that does not do what you expect? Usually, simple inspection of the code reveals the offending lines. However, debugging by code inspection is often not effective for developers new to XSLT—including those who are seasoned in manipulating XML in more procedural languages. This chapter demonstrates basic debugging techniques that offer quicker solutions to common coding mistakes and enhance your understanding of XSLT.

Many examples in this book emphasize the creation of reusable XSLT. Authors of reusable code must subject that code to more rigorous testing. By definition, reusable code is often deployed in contexts of which the author cannot have full knowledge. You should ensure that the code performs as advertised for typical inputs and boundary conditions. Reusable code should also behave predictably in the face of illegal inputs.

Developers are more likely to test when it is easy. Interpreted languages such as XSLT are typically easier to test because there is ...

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.
Start your free trial

You might also like

XSLT Cookbook

XSLT Cookbook

Sal Mangano
XSLT, 2nd Edition

XSLT, 2nd Edition

Doug Tidwell
XSLT for Dummies

XSLT for Dummies

Richard Wagner
XSLT

XSLT

Doug Tidwell

Publisher Resources

ISBN: 0596009747Supplemental ContentErrata Page