Revered monks,

XML::Saxon::XSLT2 is, as far as could see, the only Perl module on CPAN which processes stylesheets written in XSLT 2.0. It is therefore the module to use, if one wants to take advantage of the XSLT 2.0 stylesheets provided by the TEI Consortium for the transformation of xml-files structured according to the TEI Convention (http://www.tei-c.org/Tools/Stylesheets). Being the result of a decade's work and experience with TEI xml, the use of these stylesheets in a Perl environment seems quite advisable.

Users of Ubuntu 14+ are in the privileged position to simply install http://packages.ubuntu.com/trusty/perl/libxml-saxon-xslt2-perl. For the time being, I am on a Ubuntu 12 server and I am stuck with the error given below.

As the earlier error reports here (and the documentation of XML::Saxon::XSLT2) point out, one has to make sure that the module Inline::Java is installed and that the file saxonhe9.jar is present in, e.g., the directory /usr/share/java. After a good day's work, I am very sure about these two requirements. Still, my script stops in the last line given below.

use XML::Saxon::XSLT2; use Inline::Java; # not necessary my $xml_file = "/some/defintely/existing/file.xml"; my $xslt_file = "/another/definetly/existing/file.xsl"; open(my $input, '<:encoding(UTF-8)', $xml_file) or die $!; open(my $xslt, '<:encoding(UTF-8)', $xslt_file ) or die $!; my $trans = XML::Saxon::XSLT2->new($xslt);

I am getting the following errror:

Can't locate object method "new" via package "XML::Saxon::XSLT2::Transformer" (perhaps you forgot to load "XML::Saxon::XSLT2::Transformer"?) at /usr/local/share/ perl/5.14.2/XML/Saxon/XSLT2.pm line 53, <$xslt> line 1.'

The module XML::Saxon::XSLT2::Transformer doesn't exist. XSLT2.pm, line 53 reads:

    return bless { 'transformer' => XML::Saxon::XSLT2::Transformer->new($xslt) }, $class;

I would be very grateful for any idea about what could be wrong. SERVER_SOFTWARE : Apache/2.2.22 (Ubuntu). The permissons of /usr/share/java/saxonhe9.jar are: -rwxr-xr-x

Thank you!

In reply to Re: Using XML::Saxon::XSLT2 Errors by Samantabhadra
in thread Using XML::Saxon::XSLT2 Errors by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.