OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] Tests Framework for DocBook Stylesheets & Customizations?

On Thu, October 16, 2014 9:56 am, Thomas Schraitle wrote:
> when developing customizations for the DocBook stylesheets I have
> always the feeling I forget something important and work without any
> "safey net". ;)
> As such, it would be great to have a "test framework" which could
> automatically check the transformation results with the expected
> behaviour.
> I know of XSpec from Jeni Tennison which goes in this direction.
> However, as far as I know, this is for XSLT 2, not XSLT 1. It's used
> for developing and testing the upcoming XSLT 2 DocBook stylesheets.
> I'm not sure how easily could this be adapted to our current XSLT 1
> base. Are there other (better?) solutions?

I have a page about testing XSLT at
http://menteithconsulting.com/wiki/TestingXSLT that lists several XSLT 1.0

However, as Jirka said, running XSpec on your customisation won't be any
different from running a XSLT 2.0 processor directly.

> How do *you* develop and test your stylesheets? Has anybody used such
> frameworks? Any help is greatly appreciated. :)

For XSLT, I mostly use XSpec (though I still like the model of Juxy).

With XSpec, you can use whole documents as input to a test or make a
minimal context as part of the XSpec test itself.

You could probably write XSpec tests for custom templates easily enough,
but if you're setting parameters that have effect all through your output,
it would be harder to make assertions about the result.

Where the documents are complex and the stylesheets can change a lot,
tests can go out-of-date quickly, so there I tend to implement being able
to take snapshots of the output and being able to compare the current
output against a previous snapshot to see what's changed.

If you're producing XSL-FO output, you can use the open-source xmlroff
testing module or Antenna House's AHRTS to produce a report of the visual
difference between the current formatted output and a reference result.


Tony Graham                                         tgraham@mentea.net
Consultant                                       http://www.mentea.net
Chair, Print and Page Layout Community Group @ W3C    XML Guild member
  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
Mentea       XML, XSL-FO and XSLT consulting, training and programming

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]