This article will look at scripting languages that are not covered in the Xalan documentation, in particular, Python, VBScript, and PerlScript. In addition, we will show how Java Object instances, created in XSLT as part of the Java language extensions mechanism, are passed to these scripts and utilized by them. These samples will provide a solid foundation on which to build more complicated script-based extensions.
Using Script Extensions in Xalan-Java - Running the Stylesheet (Page 8 of 8 )
The samples are run using the build.xml Ant script. This script uses properties specified in the build.properties file. Ensure that the properties in this file are set correctly for your environment.
#product homes xalan.home =d:/apps/xalan-j_2_6_0 js.home =d:/apps/rhino1_5R4 jython.home =d:/apps/jython-2.1
When the properties are correctly set, run the XSLT execute:
The run target will patch the BSF JAR file if required, build the Java Lookup class used in the scripts as necessary, and then call the Xalan command line tool, which transforms the input file ./xml/ sample_in.xml into ./xml/out.xml using the XSLT file ./xml/ sample_rules.xslt.
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.