[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: ANN: 'Testing XSLT' training course PDF available

Subject: Re: ANN: 'Testing XSLT' training course PDF available
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Fri, 14 Dec 2007 19:20:06 +0530
Re:  ANN: 'Testing XSLT' training course PDF available
On Dec 14, 2007 7:06 PM, Michael Kay <mike@xxxxxxxxxxxx> wrote:
> Clearly functions are ideal for unit testing because unlike templates they
> have no context dependencies.

Thanks Mike for reminding about this. I had a feeling, that unit
testing is better possible with XSLT 2.0 ...

>But I think you can do it with templates too.
> I often exploit the XSLT 2.0 feature that allows a stylesheet to be executed
> starting at a named template; you can insert a named template that is there
> solely for testing purposes, for example
>
> <xsl:template name="test-table-rendition">
>  <xsl:apply-templates select="(//table)[1]"/>
> </xsl:template>
>
> or if you prefer you can compare the output with expected results using
> deep-equal().

I would ideally like - Have the original stylesheet (which is
undergoing testing) *unmodified*.
Write a unit testing stylesheet (which is like 1 unit test), which can
test some aspect of the original stylesheet (like a function), or
possibly test the whole stylesheet as a unit (and use deep-equal()
function to compare the expected output with the received output - but
this seems not possible without inserting a named template in the main
stylesheet).

Your named template approach, will modify the main stylesheet, which
is unlike JUnit.

Ofcouse, we can live with some limitations :)

Please correct me if I am wrong ...

-- 
Regards,
Mukul Gandhi

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.