NAME

Apache::AxKit::Util::LibXSLTAddonFunction - AxKit extension to load perl callbacks for XSL

SYNOPSIS package Apache::AxKit::Util::MiscAddonFunctions;

use base qw( Apache::AxKit::Util::LibXSLTAddonFunction );
use strict;
use XML::LibXML;
       
my $parser = XML::LibXML->new();

sub init {
    my $this = shift;
  
    $this->addRegisteredFunction( "createXMLTreeFromEscapedTags", \&createXMLTreeFromEscapedTags );
}

sub getNamespace {
    return "urn:perl-misc-addon";
}

sub createXMLTreeFromEscapedTags {
    my $val  = shift;

    $val =~ s/<\s+/&lt;/;
  
    my $doc = $parser->parse_string(<<"EOT");
<tree>
$val
</tree>
EOT
    return $doc->getElementsByTagName("tree");
}

1;

DESCRIPTION

This is an abstract base class. Classes used by Apache::AxKit::Language::LibXSLTEnhanced must inherit from this class and implement the following 2 methods:

  • init

  • getNamespace

EXPORT

None by default.

SEE ALSO

Apache::AxKit::Language::LibXSLT, AxKit, Apache::AxKit::Language::LibXSLTEnhanced

AUTHOR

Tom Schindl, <tom.schindl@bestsolution.at>

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.