Saxon and Perl
On June 18, 2010 Toby Inkster published an early version (0.003) of his module XML::Saxon::XSLT2 on ["|CPAN]. The module is still in its early phase, but this seems to be the first time that Saxon and and XSLT 2.0 become easily available from perl.
The module is based on Inline::Java which makes Java code available from Perl.
You should be able to install the module like any other module from CPAN.
perl -MCPAN -e 'install XML::Saxon::XSLT2'
should install the module, or download it from CPAN and do the install procedure manually
perl Makefile.PL make make test make install
Mainly, the module depends on Inline::Java, so if you can install that, you should have no problems. More details on dependencies [].
For more info on the usage of the module please see the documentation that comes with XML::Saxon::XSLT, for example at cpan.org with URL provided above. Maybe it still helps to some people see some actual code:
use XML::Saxon::XSLT2; open( my $source, '<:encoding(UTF-8)', $ARGV ) or die $!; open( $xslt, '<:encoding(UTF-8)', $ARGV ) or die $!; my $transformer = XML::Saxon::XSLT2->new($xslt); print $transformer->transform($source);
At some point it would be nice to know something about the performance of using XML::Saxon::XSLT2.