You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axkit-dev@xml.apache.org by ma...@sergeant.org on 2006/08/05 03:31:48 UTC

[SVN] [42] Allow XSLT() to take params

Revision: 42
Author:   matt
Date:     2006-08-05 01:31:23 +0000 (Sat, 05 Aug 2006)

Log Message:
-----------
Allow XSLT() to take params

Modified Paths:
--------------
    trunk/lib/AxKit2/Processor.pm
    trunk/lib/AxKit2/Transformer/XSLT.pm

Modified: trunk/lib/AxKit2/Processor.pm
===================================================================
--- trunk/lib/AxKit2/Processor.pm	2006-08-05 01:30:18 UTC (rev 41)
+++ trunk/lib/AxKit2/Processor.pm	2006-08-05 01:31:23 UTC (rev 42)
@@ -114,7 +114,7 @@
 
 sub XSLT {
     my $stylesheet = shift || die "XSLT requires a stylesheet";
-    return AxKit2::Transformer::XSLT->new($stylesheet);
+    return AxKit2::Transformer::XSLT->new($stylesheet, @_);
 }
 
 sub TAL {

Modified: trunk/lib/AxKit2/Transformer/XSLT.pm
===================================================================
--- trunk/lib/AxKit2/Transformer/XSLT.pm	2006-08-05 01:30:18 UTC (rev 41)
+++ trunk/lib/AxKit2/Transformer/XSLT.pm	2006-08-05 01:31:23 UTC (rev 42)
@@ -16,7 +16,9 @@
     
     my $stylesheet = shift;
     
-    return bless { stylesheet => $stylesheet }, $class;
+    my @params = @_;
+    
+    return bless { stylesheet => $stylesheet, params => \@params }, $class;
 }
 
 my %cache;
@@ -36,7 +38,7 @@
         $cache{$stylefile} = $stylesheet;
     }
     
-    my $results = $stylesheet->transform($dom);
+    my $results = $stylesheet->transform($dom, @{ $self->{params} });
     
     return $results, sub { $self->output(@_) };
 }