Commits

Shlomi Fish  committed a1b0ba6

xslt_params.

  • Participants
  • Parent commits a00f545

Comments (0)

Files changed (3)

File XML-GrammarBase/Changes

 Revision history for XML-GrammarBase
 
+v0.1.6  2013-01-20
+        - Add support for XSLT parameters into the XSLT role.
+
 v0.1.5  2013-01-18
         - More fixes to the tests and Unicode handling.
             - Test for properly emitting Unicode characters.

File XML-GrammarBase/lib/XML/GrammarBase/Role/XSLT.pm

 as C<'utf8'> (the deafult - using L<XML::LibXSLT>'s
 output_as_chars()) or as C<'bytes'> - using its output_as_bytes() .
 
+An optional 'xslt_params' parmater allows one to specify a hash of XSLT
+parameters.
+
 =cut
 
 =head2 BUILD

File XML-GrammarBase/lib/XML/GrammarBase/Role/XSLT/Global.pm

     my $is_string = ($medium eq 'string');
     my $is_dom = ($medium eq 'dom');
 
+    my $xslt_params = $args->{xslt_params} || {};
+
     if ($is_string or $is_dom)
     {
-        my $results = $stylesheet->transform($source_dom);
+        my $results = $stylesheet->transform($source_dom, %$xslt_params);
 
         return
             $is_dom