Transmorpher transformations

In Transmorpher, the transformation is the container of all the processes. It often identifies a main process (see ) that will be called when the transformation is called. These transformations are the unit to which the main operations (compiling, running, etc.) are applied.

XML declaration

In the bibliographic example, the transformation declaration is the following:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE transmorpher SYSTEM "../../dtd/transmorpher.dtd"> <transmorpher name="generateBiblio" xmlns="" xmlns:regexp="xalan://fr.fluxmedia.transmorpher.regexp.RegularExpression"> <!-- process declaration collection --> </transmorpher>

Manipulation API









Export interfaces

Export interfaces enable the use of Transmorpher transformations in various contexts. They are defined as the main process in a particular transformation (which is called when the transformation is invoked).

Under the interpretation environment of Transmorpher, all transformations are executed like a standalone transformation.

Usually, Transmorpher descriptions are interpreted at a top-level like in:

$ java -jar transmo.jar process.xml
This interpreted mode can also be invoked by any Java program or called from the Ant program. However, these transformations can be compiled into a Java program that can be invoked in another context. The form of this Java program will depend on the nature of the main element of the transformation:


The main interface allows for the implementation of a stand-alone Transmorpher transformation.

This interface is compiled as a class, named after the name of the main element implementing "runable". It can be invoked in a command line as:

java name Parameters can be passed to the running program through the use of the "-D" option as in: java name -Dinputfile=toto.xml -Douputfile=toto.html



The transformer interface is defined in the Java API for XML processing (JAXP). Transmorpher can export a transformation implementing the transformer interface. It can be called from a Java program with the JAXP interface.

Ant task

Ant declaration: <taskdef name="transmorph" classname="fr.fluxmedia.transmorpher.Application.TransmorphTask" classpath="./lib/transmo.jar"/> Using the task: <transmorph debug="2" mode="run" srcfile="../JAVA/transmorpher/samples//biblio/process.xml" message="Yurk"> <param name="myParam" select="value"/> <param name="myParam">value</param> </transmorph>

Next chapter: Generators and serializers

Feel free to comment to Jérôme:Euzenat#inrialpes:fr, $Id: main.html,v 1.5 2005-10-25 13:34:00 euzenat Exp $