use strict;
use warnings;
use Test::More tests => 5; # last test to print
use XML::XPathScript;
my $xps = XML::XPathScript->new( stylesheet => '<%~ / %>' );
# a string
$xps->set_xml( '' );
is $xps->transform, '';
# a file
$xps->set_xml( 't/t1.xml' );
is $xps->transform,
'Pokgloo?';
my $doc = $XML::XPathScript::XML_parser eq 'XML::LibXML'
? XML::LibXML->new->parse_string( '' )
: XML::XPath->new( xml => '' )
;
# a doc
$xps->set_xml( $doc );
is $xps->transform, '';
# an element
$xps->set_xml( $doc->findnodes( '/outer/inner' ) );
is $xps->transform, '';
# a fh
open my $fh, '<', 't/t1.xml';
$xps->set_xml( $fh );
is $xps->transform,
'Pokgloo?';