Page 1 of 1

How to get XALAN & JavaScript working

Posted: Tue Aug 09, 2011 1:25 pm
by UweHabel
Hello.
I tried to follow the instruction from the "Apache XML Project - XALAN - JAVA Extension" (http://www.dfki.uni-kl.de/km/java/java/ ... func-calls)
Coding the "using a JavaScript array" example. The stylesheet and the .xml can be copied from the project page.
But it is not working. If I run the translation scenario, I get an error: [Xalan]java.lang.NullPointerException - null.

Does anyone have a description on what to do to get javascript working inside Oxygen?

thanks

uwe

Re: How to get XALAN & JavaScript working

Posted: Tue Aug 09, 2011 2:40 pm
by adrian
Hello,

You need bsf.jar and js.jar in order for the Javascript extension to work with Xalan:
Xalan-Java Extensions - Setting up the runtime environment

bsf.jar can be found here:
The Jakarta Site - BSF Downloads

js.jar can be found here:
Rhino Downloads

Add the two jars to the extensions from the transformation scenario: Document -> Transformation -> Configure Transformation Scenario, press Extensions and Add them there.

Regards,
Adrian

Re: How to get XALAN & JavaScript working

Posted: Tue Aug 09, 2011 2:53 pm
by UweHabel
Hello Adrian,

thanks for the quick answer.
I already did that, but because there was no other tip, I rechecked everything.
I noticed 1 difference: on the Jakarta download page you are able to download 2 versions: 2.4.0 and 3.1
First I downloaded 3.1 and this was not working. (the file was called bsf-all-3.1.jar).
After your reply I donwloaded 2.4.0 (filename bsf.jar)

And now it works!

regards

uwe