Apache-AxKit-Language-LibXSLTEnhanced
view release on metacpan or search on metacpan
lib/Apache/AxKit/Util/LibXSLTAddonFunction.pm view on Meta::CPAN
my $doc = $parser->parse_string(<<"EOT");
<tree>
$val
</tree>
EOT
return $doc->getElementsByTagName("tree");
}
sub instanceMethod {
my $this = shift;
my $val = shift;
## this is not 100% correct
$val =~ s/<\s+/</;
my $doc = $parser->parse_string(<<"EOT");
<tree>
$val
</tree>
EOT
return $doc->getElementsByTagName("tree");
}
1;
## in XSL
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:UML="org.omg.xmi.namespace.UML"
xmlns:str="http://exslt.org/strings"
xmlns:pma="urn:perl-example-addon"
xmlns:exslt="http://exslt.org/common"
extension-element-prefixes="str">
....
<xsl:value-of select="pma:staticMethod('Hallo')" />
<xsl:value-of select="pma:instanceMethod('Hallo')" />
....
=head1 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:
=over
=item * init
=item * getNamespace
=back
=head2 EXPORT
None by default.
=head1 SEE ALSO
L<Apache::AxKit::Language::LibXSLT>, L<AxKit>, L<Apache::AxKit::Language::LibXSLTEnhanced>
=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 0.676 second using v1.01-cache-2.11-cpan-39bf76dae61 )