Monks,

in a rather solipstic continuation of solving this problem, I document the following for future stranded adepts.

First, see what the developer of XML::Saxon::LibXSLT2 has to say on Stackoverflow

Make sure to follow his advise verbosely. As, e.g., for the notorius saxon9he.jar, the developer has used version 9.5.1.7. If you use a version from 9.6. onwards you will get a "depricated" warning in the tests mentioned below. After replacing the recent saxon9he.jar with an earlier version this warning vanishes.

Testing the mainly concerned modules independently is enlighting (take, e.g., XML::Saxon::XSLT2 testcase or the "Synopsis" from Inline::Java.

I run this tests on my local PC (Ubuntu 14.04.4 LTS: trusty) and on my server (Ubuntu 12.04.5 LTS: precise). On trusty I installed the concerned modules from the repositories, on precise I installed the concerned modules manually (make file and CPAN).

On trusty both modules work as expected, on precise the tests first result in a server error when calling the testfunction with the browser.

"Couldn't find an appropriate DIRECTORY for Inline to use"

Clear. Inline::Java generates at first run the directory "_Inline" in order to its magic. See "The Inline 'directory'" in Inline. By attributing appropriate permissions to the _Inline directory this particular server error vanishes. (I attributed "drwxrwxrwx".)

With this, the test is successfull from the terminal. But while on trusty the output is printed as desired, on precise the terminal prints "XML::LibXML::Document=SCALAR(0x2a0d6f8)" instead and by calling the testfunction with the browser I stuck again with the error:

"Can't locate object method "new" via package "XML::Saxon::XSLT2::Transformer ... XSLT2.pm, line 53, line 6".

Line 53 of XSLT2.pm reads:

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

It looks like the java function in XSLT2.pm, line 377 is not accessed porperly. But why?

TobyInk, the developer of the module mentions in his comment on stackoverflow (see link above), that the JAVA_HOME environment is needed to be set.

"echo $JAVA_HOME" remains silent on both, trusty and precise. However, I set JAVA_HOME anyway (with this how to). Still, the same error.

Any help greatly appreciated.


In reply to Re^2: 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.