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 (Page 1 of 8 )
Find support files for this article here. Why Use Scripting in XSLT?
Extensible Stylesheet Language Transformations (XSLT) is an ideal language for building transformations that convert a group of XML elements into another structure. However, when it comes to transforming element values, it may be more appropriate to use different scripting languages. For example, let’s say we want to transform the following document:
Switching from XSLT to another scripting language makes sense when:
The other scripting language is easier to write than XSLT. For example, if the scripting language supports facilities that XSLT does not such as native regular expressions or easy database access features.
The script exists already - there is no need to port the transformation to XSLT!
The programmer is already very proficient in that scripting language.
This article explores how programmers can fully exploit XSLT scripting extension support in Xalan-Java.