use Test; BEGIN { plan tests => 2 } use XML::LibXML; use XML::LibXSLT; for my $p (qw( XML::LibXML::VERSION XML::LibXSLT::VERSION )) { printf "%s: %s\n", $p, $$p; } use strict; my $parser = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); # $parser->expand_entities(1); my $source = $parser->parse_string(qq{ foo}); my $style_doc = $parser->parse_string(' ]> fooöbar '); print $style_doc->toString; my $stylesheet = $xslt->parse_stylesheet($style_doc); my $results = $stylesheet->transform($source); my $tostring = $results->toString; print $tostring; ok($tostring, qr/foo(?:.|ö)bar/i); my $content = $stylesheet->output_string($results); print $content, "\n"; # libxml2-2.6.16/libxslt-1.1.9 will produce a character entity # latest versions give a UTF-8 encoded character ok($content, qr/foo(?:ö|\xC3\xB6)bar/i);