Jez Higgins

Freelance software grandad
software created
extended or repaired


Follow me on Mastodon
Applications, Libraries, Code
Talks & Presentations

Hire me
Contact

Older posts are available in the archive or through tags.

Feed

Talk: Unit Testing XSLT Stylesheets

Slides and speaker notes from a 45 minute session presented at ACCU Conference 2005.


XSLT is now a mature technology. It's widely used in web, document composition, electronic and print publishing applications, among others. Increasingly, XSLT styling isn't the last little bit at the end to create the HTML, but at the core of document creation and processing pipelines. Indeed it isn't uncommon, particularly in publishing applications, to have multiple XSLT transformation steps chained one after the other. XSLT stylesheets are getting larger and more complex, containing significant chunks of business logic.

XSLT, while addressing the specific issue transforming XML, is Turing complete. It's a real programming language, and people are doing real work with it.

Development is easier with automated testing. That's a given. That's why Ant integrates JUnit, and why C++ programmers up and down the land spend hours developing test harnesses because CppUnit just isn't quite right.

How do you test an XSLT stylesheet?

In this talk I'll present a tool for XSLT testing. Tests are described in an XML vocabulary. The test definitions are cranked through a set of XSLT stylesheets to generate Java source, more XML and yet more XSLT. The Java sources are JUnit test suites which drive the XSLT test procedure. It's all stitched together with Ant.

While the code presented is obviously in Java, the approach described can be applied to any language where suitable tools exist and could easily be ported to, say, C# or Python.


Tagged code, talk, accu-conference, and xslt


Jez Higgins

Freelance software grandad
software created
extended or repaired

Follow me on Mastodon
Applications, Libraries, Code
Talks & Presentations

Hire me
Contact

Older posts are available in the archive or through tags.

Feed