# Test forward compatibility # $Id: forward.t,v 1.2 2002/01/09 09:17:40 gellyfish Exp $ use strict; use vars qw($DEBUGGING); $DEBUGGING = 0; use Test::More tests => 8; use_ok('XML::XSLT'); my $stylesheet =< XSLT 17.0 required

Sorry, this stylesheet requires XSLT 17.0.

EOS my $parser; eval { $parser = XML::XSLT->new(\$stylesheet,debug => $DEBUGGING); die unless $parser; }; warn $@ if $DEBUGGING; ok(! $@,'Forward compatibility as per 1.1 Working Draft'); my $xml = 'Test data'; my $outstr; eval { $parser->transform($xml); $outstr = $parser->toString(); die unless $outstr; }; warn $@ if $DEBUGGING; print $outstr if $DEBUGGING; ok(! $@, 'Check it can process this'); my $wanted =<XSLT 17.0 required

Sorry, this stylesheet requires XSLT 17.0.

EOW chomp($wanted); ok($outstr eq $wanted, 'Check it makes the right output'); $stylesheet =< Sorry, this stylesheet requires XSLT 17.0. EOS eval { $parser->dispose(); }; ok(!$@, 'dispose'); eval { $parser = XML::XSLT->new( \$stylesheet,debug => $DEBUGGING) || die; }; ok(! $@, 'Another forward compat test'); eval { $parser->transform($xml); $outstr = $parser->toString(); die unless $outstr; }; print $outstr if $DEBUGGING; ok(! $@, 'Transform this'); $wanted = 'Test data'; chomp($wanted); ok($outstr eq $wanted, 'Check it makes the right output');