summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorGianni Ceccarelli <dakkar@dechirico.(none)>2009-03-25 16:48:14 +0100
committerGianni Ceccarelli <dakkar@dechirico.(none)>2009-03-25 16:48:14 +0100
commit1a2822c8b182b19d70fd116a3a0bcf038caa6aef (patch)
tree82ec103c12ab95c939980974a33be10279531649 /t
parentdoc tweak (diff)
downloadTree-Transform-XSLTish-1a2822c8b182b19d70fd116a3a0bcf038caa6aef.tar.gz
Tree-Transform-XSLTish-1a2822c8b182b19d70fd116a3a0bcf038caa6aef.tar.bz2
Tree-Transform-XSLTish-1a2822c8b182b19d70fd116a3a0bcf038caa6aef.zip
now you can specify the engine in the transfor class
Diffstat (limited to 't')
-rw-r--r--t/05-html-tree.t6
-rw-r--r--t/06-libxml.t6
2 files changed, 8 insertions, 4 deletions
diff --git a/t/05-html-tree.t b/t/05-html-tree.t
index c025251..eb990e8 100644
--- a/t/05-html-tree.t
+++ b/t/05-html-tree.t
@@ -1,9 +1,11 @@
#!perl
package HtmlTransform;{
- use Tree::Transform::XSLTish;
+ use Tree::Transform::XSLTish ':engine';
use strict;
use warnings;
+ engine_class 'XML::XPathEngine';
+
default_rules;
tree_rule match => 'img[@alt="pick"]', action => sub {
@@ -34,7 +36,7 @@ $tree->parse(<<'HTML');$tree->eof;
HTML
{
-my $trans=HtmlTransform->new(engine=>XML::XPathEngine->new());
+my $trans=HtmlTransform->new();
my @results=$trans->transform($tree);
is_deeply \@results,['this one'],'HTML example';
}
diff --git a/t/06-libxml.t b/t/06-libxml.t
index 2377738..f496301 100644
--- a/t/06-libxml.t
+++ b/t/06-libxml.t
@@ -1,9 +1,11 @@
#!perl
package XmlTransform;{
- use Tree::Transform::XSLTish;
+ use Tree::Transform::XSLTish ':engine';
use strict;
use warnings;
+ engine_class 'XML::LibXML::XPathContext';
+
default_rules;
tree_rule match => 'img[@alt="pick"]', action => sub {
@@ -31,7 +33,7 @@ my $tree=XML::LibXML->new->parse_string(<<'XML');
XML
{
-my $trans=XmlTransform->new(engine=>XML::LibXML::XPathContext->new());
+my $trans=XmlTransform->new();
my @results=$trans->transform($tree);
is_deeply \@results,['this one'],'XML example';
}