[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: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 17 Dec 2007 11:55:55 +0000
Re:  ANN: 'Testing XSLT' training course PDF available
On 17/12/2007, Tony Graham <Tony.Graham@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Fri, Dec 14 2007 12:31:37 +0000, andrew.j.welch@xxxxxxxxx wrote:
> ...
> > You mention black box testing under the unit test heading... which
> > doesn't quite fit.
> >
> > Personally I don't think you can unit test XSLT*, it's only really
> > worthwhile to test the output for a given set of inputs.
>
> Which is the sense in which I used "black box".

It's not "unit testing" then... surely?

> If the specification for the transform includes:
>
>    'art' becomes 'article' containing 'front/article-meta'.
>
> then you could use one of the unit testing frameworks to test that part
> of the specification without needing to look inside the stylesheet.  You
> could also use Schematron (Debbie Lapeyre was teaching Schematron in the
> next timeslot) or other methods to do the same thing.

Again, you can't "unit test" a transform without knowing anything
about it's internals - call it what you like but its not unit testing.

If your example requirement is to ensure that:

<art/>

becomes:

<article>
  <front>
    <article-meta>

then you could use schema aware XSLT and do:

<xsl:template match="art">
        <article xsl:type="article">

...which provided article was defined correctly in the schema it would
give you confidence that if <art/> occurred in the input that
structure would alwats be produced.

Couple that will overall result validation containing XSD 1.1 asserts
and I think that's an ideal testing framework.



-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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.