Debian Codegraph @

Embperl/Recipe/EmbperlXSLT.pm

raw
1
2 ###################################################################################
3 #
4 # Embperl - Copyright (c) 1997-2008 Gerald Richter / ecos gmbh www.ecos.de
5 # Embperl - Copyright (c) 2008-2014 Gerald Richter
6 #
7 # You may distribute under the terms of either the GNU General Public
8 # License or the Artistic License, as specified in the Perl README file.
9 #
10 # THIS PACKAGE IS PROVIDED 'AS IS' AND WITHOUT ANY EXPRESS OR
11 # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
12 # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13 #
14 # $Id: EmbperlXSLT.pm 1578075 2014-03-16 14:01:14Z richter $
15 #
16 ###################################################################################
17
18
19
20 package Embperl::Recipe::EmbperlXSLT ;
21
22 use strict ;
23 use vars qw{@ISA} ;
24
25 use Embperl::Recipe::Embperl ;
26
27 @ISA = ('Embperl::Recipe::Embperl') ;
28
29 # ---------------------------------------------------------------------------------
30 #
31 # Create a new recipe by converting request parameter
32 #
33 # ---------------------------------------------------------------------------------
34
35
36 sub get_recipe
37
38 {
39 my ($class, $r, $recipe, $src, $syntax) = @_ ;
40
41 my $ep = Embperl::Recipe::Embperl -> get_recipe ($r, $recipe, $src, $syntax) ;
42 my $param = $r -> component -> param ;
43 return $ep if ($param -> import >= 0) ;
44
45 my $config = $r -> component -> config ;
46 my $xsltproc = $config -> xsltproc ;
47
48 my @stylesheet =
49 (
50 { type => 'file', filename => $config -> xsltstylesheet, },
51 { type => $xsltproc . '-compile-xsl', cache => 1 },
52 ) ;
53
54
55 push @$ep, {'type' => 'eptostring' } ;
56 push @$ep, {'type' => $xsltproc . '-parse-xml', } ;
57 push @$ep, {'type' => $xsltproc, stylesheet => \@stylesheet, $param -> xsltparam?():
58 (param => { map { my $v = $Embperl::fdat{$_} ; $v =~ s/\'/'/g ; ($_ => "'$v'") } keys %Embperl::fdat }) } ;
59
60 return $ep ;
61 }
62
63
64 1 ;
65
66 __END__
67
68 =pod
69
70 =head1 NAME
71
72 Embperl::Recipe::EmbperlXSLT - recipe to perform an XSLT transformation last
73
74 =head1 SYNOPSIS
75
76
77 =head1 DESCRIPTION
78
79 This recipe does an XSLT transformation after normal Embperl processing.
80
81 =head1 Author
82
83 G. Richter (richter at embperl dot org)
84
85 =head1 See Also
86
87 L<Embperl::Recipe|EmbperlRecipe.pod>
88
89 L<Embperl::Recipe::XSLT|EmbperlRecipe/XSLT.pod>
90
91
92
93