% no strict 'refs'; % use XML::LibXML; % use XML::LibXSLT; FilterProxy::XSLT Config

FilterProxy::XSLT Config <% (defined $SITE)?"for site $SITE":"" %>

<% $MESSAGE %>

Back to FilterProxy main configuration. % if(defined $SITECONFIG) {

FilterProxy::XSLT options for site <% $SITE %>

Stylesheet:

Ignore: {ignore}?"checked":"" %>>

% if(defined $SITECONFIG->{'stylesheet'}) {

Parameters

% my($name, $param, $value); % foreach $param (sort @{$SITECONFIG->{params}}) { % if($param =~ /^([^=]+)=\s*(.*?)\s*$/) { % $name = $1; % $value = $2; % } else {

Error in Parameter:

<% $param %> % return; % } % $value =~ s/>/>\;/g; % $value =~ s/ % } # foreach $param % my $fname = $FilterProxy::HOME . "/xsl/" . $SITECONFIG->{'stylesheet'}; % if (defined $SITECONFIG->{'stylesheet'} && % -r $fname){ % my $parser = XML::LibXML->new(); % my $xslt = XML::LibXSLT->new(); % my $source = $parser->parse_file($fname); % my $style_doc = $parser->parse_string( % ''. % ''. % ' '. % ' '. % ' '. % ' ='. % ' '. % " \n". % ' '. % ' '. % ' '. % ' '. % '' ); % my $stylesheet = $xslt->parse_stylesheet($style_doc); % my $results = $stylesheet->transform($source); % my @arr = split "\n", $stylesheet->output_string($results); % my($usedarg)=0; % # Count the number of used parameters. % foreach (@arr) { % /^([^=]+)=(.*)$/; % my($param) = $1; % foreach (@{$SITECONFIG->{params}}) { % if (/^$param/) { % $usedarg++; % } % } % } % my $chooseable = 0; % if($usedarg < scalar @arr) { % if ( $chooseable == 1) { % } % } % } else { % } # if -r stylefile
Name Value Submit
<% $name %>

Add parameter:

% } else {
File not found
% } % } else {
FilterProxy::XSLT global options
% }

What is XSLT?

XSLT is short for XML Stylesheet Language Transformations. XSLT is a W3C Recommendation, and it transforms XML documents into other XML documents by means of a "stylesheet", which is also specified as an XML document. FilterProxy stores these transformations in the directory xsl/. To create new XSL transformations, create a .xsl file in this directory, and then select it in the dialog box above.

Here is a tutorial on writing XSL, and here is an XSLT reference

The XSLT module is very new. If you write an interesting XSL script, please send a copy to me so that it might be included with FilterProxy. XSLT is extremely powerful, and there are probably a lot of interesting things that could be done with it that I haven't thought of yet.


FilterProxy::XSLT was written by Mario Lang. Please see the README, BUGS, and any relevant module documentation before mailing me with problems.