On 20/07/2010 14:27, Ryan Puddephatt wrote:

Hi,

                Has anyone used Saxon to get Code Coverage information for XSL files when testing. Some of our XSLs require a large amount of unit-testing (so to speak) and I want to make sure every condition is covered

 

Thanks

 

Ryan

 

Ryan Puddephatt

Buy-side Connectivity Developer

Fidessa 
Direct:   +44 (0) 20 7105 1821
Fax:      +44 (0) 20 7105 1001

Email:    ryan.puddephatt@fidessa.com
Web:     www.fidessa.com

 



The TimedTraceListener is primarily intended to show how much execution time is spent in each template/function, but it also shows how many times each template/function was invoked. Details at

http://www.saxonica.com/documentation/using-xsl/performanceanalysis.html

It doesn't tell you which templates weren't invoked (!), but a few tweaks to the timing-profile.xsl stylesheet, using the source stylesheet as an additional input, should give you that information.

You could also without too much difficulty adapt the TimedTraceListener to give finer-grained coverage analysis, by recording more detailed events notified to the TraceListener interface.

Michael Kay
Saxonica