How to get XALAN & JavaScript working

Here should go questions about transforming XML with XSLT and FOP.
UweHabel
Posts: 2
Joined: Tue Aug 09, 2011 1:11 pm

How to get XALAN & JavaScript working

Post 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
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: How to get XALAN & JavaScript working

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
UweHabel
Posts: 2
Joined: Tue Aug 09, 2011 1:11 pm

Re: How to get XALAN & JavaScript working

Post 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
Post Reply