[ external icon ]

External transformations

External processes allow users to take advantage of a transformation program that is not specific to Transmorpher. This can be very useful when some legacy programs exist, when one can implement more easily some transformations in another language or when Transmorpher is too limited for expressing the required transformation.

An external process can have several inputs and outputs, and is identified by its type. It can also take parameters under the form of a file (this is too limiting however and, in the future, we will introduce true parameters).

XML declaration

The apply-external element introduces the use of an external transformation in a process body. Its structure is the following:

<apply-external type="type" id="id" in="channels" out="channels"> {<with-param>}* </apply-external>

In the bibliography example, the external XSLT processes are used for sorting and formatting:

<apply-external type="xslt" id="SortTypeYear" in="X11" out="X2"> <with-param name="file">biblio/sort-ty.xsl</with-param> </apply-external> <apply-external type="xslt" id="FormatHTML" in="X2" out="X3"> <with-param name="file">biblio/form-harea.xsl</with-param> </apply-external> <apply-external type="xslt" id="SortCategYear" in="X12" out="Y2"> <with-param name="file">biblio/sort-cya.xsl</with-param> </apply-external> <apply-external type="xslt" id="FormatBib" in="Y2" out="Y3"> <with-param name="file">biblio/form-bibtex.xsl</with-param> </apply-external> <apply-external type="xslt" id="FormatXML" in="D3" out="Z3"> <with-param name="file">biblio/xmlverbatimwrapper.xsl</with-param> </apply-external>

Built-in externals

Transmorpher provides an XSLT external process type which enables the processing of XSLT stylesheets already defined (this was the case of the stylesheets of the bibliography example which have not been changed to run under Transmorpher). Of course, the XSLT external processes have only one input and one output. Our implementation takes advantage of JAXP for better portability.

References to contributed extensions can be found here

Manipulation API

Extension API

Extensions must implement the fr.fluxmedia.transmorpher.TProcessFactory.TApplyProcess interface.

Next chapter: Iterators

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