Subject: [xsl] Junit-type Framework for XSLT 2 Functions and Templates? From: Eliot Kimber <ekimber@xxxxxxxxxxxxxxxxxxx> Date: Mon, 16 May 2005 09:42:06 -0500 |
I've started doing work with XSLT 2 and I'm finding that, with the new built-in function mechanism in XSLT 2, along with all the new built-in functions string processing and what not, that I'm writing more XSLT-level functions that I have in the past (in the past I would tend to write these functions as Java extension functions).
As these functions tend to be easily testable using automated tests I naturally created another test XSLT that provides unit tests for these functions. But it's not quite as convenient as having a real unit test framework ala JUnit.
I'm wondering if anyone has thought about the best way to implement a unit testing framework for XSLT 2? The approach I'm thinking about at the moment would use one transform to process a set of unit test templates in order to generate a new transform that would run the tests and apply the results.
Another approach that might be productive would be to write a Java application that evaluates an input transform consisting of unit test templates and then applying those templates individually, under Java control (and in this case you could even make each template call part of a real JUnit unit test, letting you take advantage of support for JUnit in tools like Eclipse). But this would be a Java-centric approach and it would probably be better to have something that is pure XSLT.
I haven't pushed on it, but it would be ideal if there was some way to apply the sort of introspection approach that JUnit uses--that is, have a transform that processes itself in order to find the test case templates and run them, reporting success or failure. But I don't think there's any way to do this directly (because there's no evaluate() function in standard XSLT.
Eliot -- W. Eliot Kimber Professional Services Innodata Isogen 9390 Research Blvd, #410 Austin, TX 78759 (512) 372-8155
ekimber@xxxxxxxxxxxxxxxxxxx www.innodata-isogen.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] end-tag minimization prob, David Carlisle | Thread | RE: [xsl] Junit-type Framework for , Michael Kay |
RE: [xsl] flat XML to normal XML, Aron Bock | Date | RE: [xsl] flat XML to normal XML, Michael Kay |
Month |