SVG - Scalable Vector Graphics is a modular language for describing two-dimensional vector and mixed vector/raster graphics in XML. Batik is a Java-based toolkit for applications that want to use images in the SVG format for display, generation or manipulation. Batik supports script tag of SVG. The script tag can be used to implement interactivity, animation and so on. Batik uses Mozilla Rhino based JavaScript implementation with script tag implementation.
I've just added support for using any jsr-223 compatible scripting languages (like the ones at scripting.dev.java.net) with SVG. The source for SVG jsr-223 script extension is available at scripting.dev.java.net project. You may want to refer to README.TXT of this project.