blib/lib/Embperl/Recipe/EmbperlXSLT.pm untested

filter: Statementstmt 0.0% 0 / 33 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 43 CC 3 SCAR 18.4
CC
3
Cov
0%
get_recipe
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 6.3
1  
2 ###################################################################################
3 #
4 # Embperl - Copyright (c) 1997-2008 Gerald Richter / ecos gmbh www.ecos.de
5 # Embperl - Copyright (c) 2008-2015 Gerald Richter
6 # Embperl - Copyright (c) 2015-2023 actevy.io
7 #
8 # You may distribute under the terms of either the GNU General Public
9 # License or the Artistic License, as specified in the Perl README file.
10 #
11 # THIS PACKAGE IS PROVIDED 'AS IS' AND WITHOUT ANY EXPRESS OR
12 # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
13 # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14 #
15 ###################################################################################
16
17  
18  
19 package Embperl::Recipe::EmbperlXSLT ;
20  
21 use strict ;
22 use vars qw{@ISA} ;
23  
24 use Embperl::Recipe::Embperl ;
25  
26 no warnings "uninitialized" ;
27  
28 @ISA = ('Embperl::Recipe::Embperl') ;
29  
30 # ---------------------------------------------------------------------------------
31 #
32 # Create a new recipe by converting request parameter
33 #
34 # ---------------------------------------------------------------------------------
35  
36  
37 sub get_recipe
38  
39 {
40 my ($class, $r, $recipe, $src, $syntax) = @_ ;
41  
42 my $ep = Embperl::Recipe::Embperl -> get_recipe ($r, $recipe, $src, $syntax) ;
43 my $param = $r -> component -> param ;
44 return $ep if ($param -> import >= 0) ;
45  
46 my $config = $r -> component -> config ;
47 my $xsltproc = $config -> xsltproc ;
48  
49 my @stylesheet =
50 (
51 { type => 'file', filename => $config -> xsltstylesheet, },
52 { type => $xsltproc . '-compile-xsl', cache => 1 },
53 ) ;
54  
55  
56 push @$ep, {'type' => 'eptostring' } ;
57 push @$ep, {'type' => $xsltproc . '-parse-xml', } ;
58 push @$ep, {'type' => $xsltproc, stylesheet => \@stylesheet, $param -> xsltparam?():
59 (param => { map { my $v = $Embperl::fdat{$_} ; $v =~ s/\'/'/g ; ($_ => "'$v'") } keys %Embperl::fdat }) } ;
60  
61 return $ep ;
62 }
63  
64  
65 1 ;
66  
67 __END__