Apache-AxKit-Language-LibXSLTEnhanced

 view release on metacpan or  search on metacpan

lib/Apache/AxKit/Language/LibXSLTEnhanced.pm  view on Meta::CPAN

            }
        }

        unless ($r->dir_config('AxDisableXSLTStylesheetCache')) {
            $style_cache{$style->key()} = 
                { style => $stylesheet, mtime => time, depends => [ get_depends() ] };
        }
    }

    # get request form/querystring parameters
    my @params = fixup_params($class->get_params($r));

    AxKit::Debug(7, "[LibXSLT] performing transformation");

    my $results = $stylesheet->transform($xml_doc, @params);
    
    AxKit::Debug(7, "[LibXSLT] transformation finished, creating $results");
    
    if ($last_in_chain) {
        AxKit::Debug(8, "[LibXSLT] outputting to \$r");
        if ($XML::LibXSLT::VERSION >= 1.03) {
            my $encoding = $stylesheet->output_encoding;
            my $type = $stylesheet->media_type;
            $r->content_type("$type; charset=$encoding");
        }
        $stylesheet->output_fh($results, $r);
    }

    AxKit::Debug(7, "[LibXSLT] storing results in pnotes(dom_tree) ($r)");
    $r->pnotes('dom_tree', $results);
    
#         warn "LibXSLT returned $output \n";
#         print $stylesheet->output_string($results);
    return Apache::Constants::OK;

}

sub fixup_params {
    my @results;
    while (@_) {
        push @results, XML::LibXSLT::xpath_to_string(
                splice(@_, 0, 2)
                );
    }
    return @results;
}

1;








# Preloaded methods go here.

1;
__END__
# Below is stub documentation for your module. You'd better edit it!

=head1 NAME

Apache::AxKit::Language::LibXSLTEnhanced - AxKit extension to load perl callbacks for XSL

=head1 SYNOPSIS
  
  <Files *.zuml>
      AxAddStyleMap text/xsl Apache::AxKit::Language::LibXSLTEnhanced
      PerlAddVar LibXSLTFunctionsModule BestSolution::AddonFunctions
  </Files>

=head1 DESCRIPTION

This module is working completly like Language::LibXSLT but it support registering 
perl-functions which can be used in XSL-Stylesheets. To add a Perl-Callbacks you
have to use PerlAddVar as shown in synopsis. The module loaded has to inherit from
L<Apache::AxKit::Util::LibXSLTAddonFunction>

=head2 EXPORT

None by default.

=head1 SEE ALSO

L<Apache::AxKit::Language::LibXSLT>, L<AxKit>, L<Apache::AxKit::Util::LibXSLTAddonFunction>

=head1 AUTHOR

Tom Schindl, E<lt>tom.schindl@bestsolution.atE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2004 by Tom Schindl

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.3 or,
at your option, any later version of Perl 5 you may have available.


=cut



( run in 1.709 second using v1.01-cache-2.11-cpan-39bf76dae61 )