|
/usr/local/perl/lib/site_perl/5.6.1/sun4-solaris/HTML/Embperl/Recipe.pm |
Embperl base class for defining custom recipes
PerlSetEnv EMBPERL_RECIPE ``XSLT Embperl''
HTML::Embperl::Recipe provides basic features that are necessary for createing
your own recipes.
To do so you have to create a class that provides a new method which returns
a hash that contains the description what to do.
The function must return a hash that describes the desired action. The hash contains a tree structure of providers.
Parameter:
Parameter:
Parameter:
Parameter:
Parameter:
Parameter:
Parameter:
Parameter:
Parameter:
Parameter:
Parameter:
Parameter:
Heres an example that show how the hash must be build:
sub new
{
my ($class, $r, $recipe, $param) = @_ ;
my $self =
{
'provider' =>
{
'type' => 'xalan',
'source' =>
{
'cache' => 0,
provider =>
{
'type' => 'xalan-parse-xml',
'source' =>
{
'cache' => 0,
provider =>
{
'type' => 'file',
'filename' => $param -> {inputfile},
}
},
},
},
'stylesheet' =>
{
'cache' => 1,
provider =>
{
'type' => 'xalan-compile-xsl',
'stylesheet' =>
{
'cache' => 0,
provider =>
{
'type' => 'file',
'filename' => $param -> {xsltstylesheet},
}
},
},
}
}
} ;
return $self ;
}
This corresponds to the following diagramm:
+-------------------+ +--------------------+
+ file {inputfile} + +file{xsltstylesheet}+
+-------------------+ +--------------------+
| |
v v
+-------------------+ +-------------------+
+ xalan-parse-xml + + xalan-compile-xsl +
+-------------------+ +-------------------+
| |
| |
| +-----------+ |
+-------> + xalan + <-+
+-----------+
Take a look at the recipes that comes with Embperl to get more ideas what can be done.
|
/usr/local/perl/lib/site_perl/5.6.1/sun4-solaris/HTML/Embperl/Recipe.pm |