-1

I am currently trying to use the XSLT2 module in a Perl script. I am currently getting an error when running the script due to including this module. The main error statement is:

Transformer.java:1: error: package net.sf.saxon.s9api does not exist

I'm assuming this means that when I installed XML::Saxon::XSLT2, it didn't know where the Saxon jar file was. I have it on my computer but I'm not sure how to get Inline::Java or XSLT2 to recognize that it's there or install it or do whatever I have to do. Sorry, I don't really know too much about Java and classpaths and what not so I'm sort of in the black on this issue.

RobEarl
  • 7,862
  • 6
  • 35
  • 50
OstrichProjects
  • 318
  • 1
  • 2
  • 13

1 Answers1

0

This module implements XSLT 1.0 and 2.0 using Saxon 9.x via Inline::Java.

It expects Saxon to be installed in either:

'/usr/share/java/saxon9he.jar'   

or:

'/usr/local/share/java/saxon9he.jar'

Future versions should be more flexible. The saxon9he.jar file can be found at http://saxon.sourceforge.net/ - just dowload the latest Java release of Saxon-HE 9.x, open the Zip archive, extract saxon9he.jar and save it to one of the two directories above.

http://metacpan.org/pod/XML::Saxon::XSLT2

So just cd to the directory where you currently have the saxon jar file and type:

$ mv saxon9he.jar /usr/local/share/java/
szabgab
  • 6,202
  • 11
  • 50
  • 64
7stud
  • 46,922
  • 14
  • 101
  • 127
  • So just adding the directory that I have it saved to worked. That's fine for what I'm doing right now, but I want to create a standalone executable. Usually creating executables from perl isn't to bad, but I don't know how I'm going to specify the correct path when it goes into the executable. Is there anyway to specify a path that will let me just keep the jar file in the same path as the module file. – OstrichProjects Jun 28 '13 at 02:18
  • You cross posted this at perlmonks, so thanks for wasting my time. – 7stud Jun 28 '13 at 02:28