File: 05quick.t

package info (click to toggle)
libxml-libxslt-perl 1.59-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 236 kB
  • ctags: 206
  • sloc: perl: 707; ansic: 265; makefile: 53; xml: 21
file content (26 lines) | stat: -rw-r--r-- 835 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use Test;
BEGIN { plan tests => 7 }
use XML::LibXSLT;
use XML::LibXML;

# this test is here because Mark Cox found a segfault
# that occurs when parse_stylesheet is immediately followed
# by a transform()

my $parser = XML::LibXML->new();
my $xslt = XML::LibXSLT->new();
ok($parser); ok($xslt);
my $source = $parser->parse_file('example/1.xml');
ok($source);
my $style_doc = $parser->parse_file('example/1.xsl');
my $stylesheet = $xslt->parse_stylesheet($style_doc);
my $results = $stylesheet->transform($source);
ok($stylesheet->output_string($results));

$source = $parser->parse_file('example/2.xml');
ok($source);
$style_doc = $parser->parse_file('example/2.xsl');
$stylesheet = $xslt->parse_stylesheet($style_doc);
$results = $stylesheet->transform($source);
ok($stylesheet->media_type);
ok($stylesheet->output_string($results));