Commit e2a19066 authored by Fabien Triolet's avatar Fabien Triolet
Browse files

First version of input files

parent 168e1b37
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Id: chapter.dtd,v 1.1 2003-04-09 14:22:36 triolet Exp $-->
<!-- Une DTD trs simplifie pour des livres -->
<!-- Les chapitres -->
<!ELEMENT chapter (title, para*, sect1*)>
<!ATTLIST chapter
id CDATA #IMPLIED
next CDATA #IMPLIED
previous CDATA #IMPLIED
type CDATA #IMPLIED>
<!-- Les sections de premier niveau -->
<!ELEMENT sect1 (title, (para|list|figure|block|sect2|code|table)*)>
<!ELEMENT sect2 (title, (para|list|figure|code|table)*)>
<!-- Les paragraphes -->
<!ELEMENT title (#PCDATA)>
<!ELEMENT para (#PCDATA|em|code|figref|bold|element|list|block)*>
<!ELEMENT em (#PCDATA|code)*>
<!ELEMENT bold (#PCDATA)>
<!ELEMENT block (#PCDATA|para|list)*>
<!ELEMENT element (#PCDATA)>
<!ELEMENT code (#PCDATA|em)*>
<!-- Les listes -->
<!ELEMENT list (item+)>
<!ATTLIST list
ordonnee (y|n) "n"><!-- a priori pas "ordonne" -->
<!ELEMENT item (para|code)+>
<!-- Les figures -->
<!ELEMENT figure EMPTY>
<!ATTLIST figure
id ID #REQUIRED
src CDATA #REQUIRED
legende CDATA #REQUIRED>
<!-- Rfrence une figure -->
<!ELEMENT figref EMPTY>
<!ATTLIST figref
idref IDREF #REQUIRED>
<!ELEMENT table (headercell|cell|row)*>
<!ELEMENT headercell (para)>
<!ATTLIST headercell
width CDATA #IMPLIED>
<!ELEMENT cell (para)>
<!ATTLIST cell
width CDATA #IMPLIED>
<!ELEMENT row (headercell|cell)*>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Id: annot.xml,v 1.1 2003-04-09 14:22:36 triolet Exp $-->
<chapter id="annot" type="chapter" previous="channels" next="install">
<title>Annotations</title>
<para>The goal of Transmorpher is to have an intelligible expression of transformations.
It should provide in the near future the opportunity to annotate the various components
of the transformations. Among these annotations, there should be assertions of properties
satisfied by transformations (terminates, returns a document satisfying some particular
DTD, preserves the order of some elements, etc.). We also consider adding the
mathematical proofs of these properties.</para>
<para>This will be developed later as an extension </para>
<sect1>
<title>Assertions</title>
</sect1>
<sect1>
<title>Proofs</title>
</sect1>
</chapter>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Id: channels.xml,v 1.1 2003-04-09 14:22:36 triolet Exp $-->
<chapter id="channels" type="chapter" previous="rulesets" next="annot">
<title>Channels</title>
<para>The channels are present in the Transmorpher transformations as names in the in and out
attributes of all other elements (and the test attribute of the repeat element). They are identified
by their names. Because the channel separator in the in and out attributes is the space (ascii 20), it
is not possible to have spaces in channel names.</para>
<para><code><![CDATA[
<process name="myproc" in="c1" out="c2 c3">
<dispatch type="broadcast" id="dp" in="c1" out="c2 c3"/>
</process> ]]></code></para>
<sect1>
<title>Content, encoding and types</title>
<para>So far, the channels always carry SAX 2.0 (Simple API for XML) events in which characters are
encoded in UTF-8. There is no explicit notion of DTD for these SAX event streams. So validation cannot
take place on them. </para>
</sect1>
<sect1>
<title>Standard input and output</title>
<para>Standard input and output are denoted by the channel names _stdin_ and _stdout_ . The
standard input can only be used in standlone external interface (or main ), the standard output
can be used both in the standalone and the servlet external interfaces.</para>
<para><code><![CDATA[
<main>
<apply-process name="myproc" id="mp" in="_stdin_" out="_stdout_ c"/>
<serialize type="" id="ser" in="c">
<with-param name="file">myfile.xml</with-param>
</serialize>
</main>]]></code></para>
<para>[TO BE CHANGED]</para>
</sect1>
<sect1>
<title>The _null_ channel</title>
<para>The null channel is used when the output of a particular call is not useful and has to be
ignored. This special channel is denoted by the _null_ and can be used everywhere an output channel
is used. </para>
<para><code><![CDATA[
<process name="myproc2" in="c1" out="c2">
<apply-process name="myproc" id="mp" in="c1" out="c2 _null_"/>
</process> ]]></code></para>
</sect1>
</chapter>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Id: contrib.xml,v 1.1 2003-04-09 14:22:36 triolet Exp $-->
<chapter id="contrib" previous="dev" type="appendice" next="quickref" >
<title>Overview of the contributed modules</title>
<sect1>
<title>Generators</title>
<sect2>
<title>readvcs</title>
<para>Author: Bruno Charre (INRIA Rhône-Alpes)</para>
<para>Reads a vCal or vCard file and generates its XML representation</para>
<para>Declaration:</para>
<code><![CDATA[<defextern name="readvcs"
class="fr.fluxmedia.tmcontrib.generator.readvcs"
implements="generator"/>]]></code>
<para>Parameters:</para>
<para>file - the name of the file or the URL to read</para>
<para>type - vcal or vcard</para>
<para>Classes: readvcs and vcsReader</para>
<para>Use:</para>
<code><![CDATA[<generate id="readVCS" type="readvcs" out="o">
<with-param name="file">file name or URL</with-param>
<with-param name="type">vcal or vcard</with-param>
</generate>]]></code>
<para>Requires: Mail API from Sun Microsystem (included in JDK 1.4)</para>
</sect2>
<sect2>
<title>tidy</title>
<para>Author: Fabien Triolet (INRIA Rhône-Alpes)</para>
<para>Parses an HTML file, transforms it into XHTML and generates the results.</para>
<para>Declaration:</para>
<code><![CDATA[<defextern name="tidy"
class="fr.fluxmedia.tmcontrib.generator.tidy"
implements="generator"/>]]></code>
<para>Parameters:</para>
<para>file - the name of the file or the URL to read</para>
<para>Classes: tidy</para>
<para>Use:</para>
<code><![CDATA[<generate id="tidyURL" type="tidy" out="o">
<with-param name="file">http://transmorpher.inrialpes.fr</with-param>
</generate>]]></code>
<para>Requires: JTidy by ...</para>
</sect2>
<sect2>
<title>ReadCSV</title>
<para>Author: Fabien Triolet (INRIA Rhône-Alpes). Based on code sample in "Java and XSLT"
by Eric M. Burke(O'Reilly)</para>
<para>Reads a csv file and generates its XML representation</para>
<para>Declaration:</para>
<code><![CDATA[<defextern name="readcsv"
class="fr.fluxmedia.tmcontrib.generator.ReadCSV"
implements="generator"/>]]></code>
<para>Parameters:</para>
<para>file - the name of the file or the URL to read</para>
<para>separator - the separator char</para>
<para>Classes: ReadCSV and CSVXMLReader</para>
<para>Use:</para>
<code><![CDATA[<generate id="readCSV" type="readcsv" out="o">
<with-param name="file">file name or URL</with-param>
<with-param name="separator">,</with-param>
</generate>]]></code>
<para>Requires: nothing</para>
</sect2>
</sect1>
<sect1>
<title>Serializers</title>
<sect2>
<title>writevcs</title>
<para>Author: Bruno Charre (INRIA Rhône-Alpes)</para>
<para>Takes a flux containing vCal/vCard items in XML and generates the corresponding vCal vCard files.</para>
<para>Declaration:</para>
<code><![CDATA[<defextern name="writevcs"
class="fr.fluxmedia.tmcontrib.serializer.writevcs"
implements="serializer"/>]]></code>
<para>Parameters:</para>
<para>file - the name of the file to write</para>
<para>type - vcal or vcard</para>
<para>Classes: writevcs</para>
</sect2>
<sect2>
<title>PDFSerializer</title>
<para>Author: Fabien Triolet (INRIA Rhône-Alpes)</para>
<para>Generates a PDF or PS file from an input channel in the Formating Object format.</para>
<para>Declaration:</para>
<code><![CDATA[<defextern name="PDFSerializer"
class="fr.fluxmedia.tmcontrib.serializer.PDFSerializer"
implements="serializer"/>]]></code>
<para>Parameters:</para>
<para>file - the name of the file to write</para>
<para>format - pdf or ps</para>
<para>Classes: PDFSerializer.</para>
<para>Use:</para>
<code><![CDATA[<serialize id="outputPDF" type="PDFSerializer" in="i">
<with-param name="file">aFile.pdf</with-param>
<with-param name="format">pdf</with-param>
</serialize>]]></code>
<para>Requires: Apache FOP (0.20.4), Batik (1.5beta2) and Jakarta Avalon (4.0) and Logkit (1.0).</para>
</sect2>
<sect2>
<title>RTFSerializer</title>
<para>Author: Fabien Triolet (INRIA Rhône-Alpes)</para>
<para>Takes a Formating Object document as input and generates the corresponding RTF file.</para>
<para>Declaration:</para>
<code><![CDATA[<defextern name="RTFSerializer"
class="fr.fluxmedia.tmcontrib.serializer.RTFSerializer"
implements="serializer"/>]]></code>
<para>Parameters:</para>
<para>file - the name of the file to write</para>
<para>format - rtf</para>
<para>Classes: RTFSerializer.</para>
<para>Use:</para>
<code><![CDATA[<serialize id="outputRF" type="RTFSerializer" in="i">
<with-param name="file">aFile.rtf</with-param>
<with-param name="format">rtf</with-param>
</serialize>]]></code>
<para>Requires: jfor (0.7.1)</para>
</sect2>
</sect1>
<sect1>
<title>Mergers</title>
</sect1>
<sect1>
<title>Dispatchers</title>
</sect1>
<sect1>
<title>External transformations</title>
</sect1>
<sect1>
<title>Iterators</title>
</sect1>
<sect1>
<title>Queries</title>
</sect1>
</chapter>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Id: depend.xml,v 1.1 2003-04-09 14:22:36 triolet Exp $-->
<chapter id="depend" type="appendice" previous="install" next="dtd">
<title>Dependency matrix</title>
<sect1>
<title></title>
<para>Using Transmorpher requires several freely available software:</para>
<list>
<item><para>A Java Virtual Machine;</para></item>
<item><para>SAX and JAXP APIs;</para></item>
<item><para>An XML parser;</para></item>
<item><para>An XSLT engine;</para></item>
<item><para>A regular expression substituer (optional);</para></item>
<item><para>A servlet server (optional);</para></item>
</list>
<para>The current version of Transmorpher uses the following version of these software (some other configurations also works,
this is not exhaustive):</para>
<table>
<row>
<headercell width="35mm"><para><bold>Software</bold></para></headercell><headercell width="35mm"><para>Brand</para></headercell><headercell width="20mm"><para>V min.</para></headercell><headercell width="20mm"><para>V. Max</para></headercell><headercell width="35mm"><para>Jar</para></headercell>
</row>
<row>
<cell><para>Java VM</para></cell><cell><para>Sun JDK</para></cell><cell><para>1.3</para></cell><cell><para></para></cell><cell><para></para></cell>
</row>
<row>
<cell><para>SAX/JAXP</para></cell><cell><para>Oasis</para></cell><cell><para>2.0/1.1</para></cell><cell><para>2.0/1.1</para></cell><cell><para>xml-apis.jar</para></cell>
</row>
<row>
<cell><para>XML parser</para></cell><cell><para>Apache Xerces</para></cell><cell><para>2.1</para></cell><cell><para>2.1</para></cell><cell><para>xercesImpl.jar</para></cell>
</row>
<row>
<cell><para>XSLT processor</para></cell><cell><para>Apache Xalan</para></cell><cell><para>2.4</para></cell><cell><para>2.4D1</para></cell><cell><para>xalan.jar</para></cell>
</row>
<row>
<cell><para>Regular expressions</para></cell><cell><para>gnu.regexp</para></cell><cell><para>1.1.3</para></cell><cell><para>1.1.4</para></cell><cell><para>gnu-regexp-1.1.4.jar</para></cell>
</row>
<row>
<cell><para>Servlet server</para></cell><cell><para>Jakarta Tomcat</para></cell><cell><para>4.0.4</para></cell><cell><para>4.0.4</para></cell><cell><para>servlet.jar</para></cell>
</row>
</table>
<para>Other extensions of Transmorpher might require external software as indicated in their
description.</para>
<para>Compatibility table for former Transmorpher versions:</para>
<table>
<row>
<headercell width="20mm"><para>Date</para></headercell><headercell width="20mm"><para>Version</para></headercell><headercell width="20mm"><para>Java</para></headercell><headercell width="20mm"><para>Parser</para></headercell><headercell width="20mm"><para>Xslt</para></headercell><headercell width="20mm"><para>regexp</para></headercell><headercell width="20mm"><para>servlet</para></headercell><headercell width="20mm"><para>Note</para></headercell>
</row>
<row>
<cell width="20mm"><para>14/02/2003</para></cell><cell width="20mm"><para>1-0-3</para></cell><cell width="20mm"><para>1.3</para></cell><cell width="20mm"><para>Xerces2.1</para></cell><cell width="20mm"><para>Xalan2.4</para></cell><cell width="20mm"><para>1.1.3</para></cell><cell width="20mm"><para>4.0.4</para></cell><cell width="20mm"><para></para></cell>
</row>
<row>
<cell width="20mm"><para>03/02/2003</para></cell><cell width="20mm"><para>1-0-2</para></cell><cell width="20mm"><para>1.3</para></cell><cell width="20mm"><para>Xerces2.1</para></cell><cell width="20mm"><para>Xalan2.4</para></cell><cell width="20mm"><para>1.1.3</para></cell><cell width="20mm"><para>4.0.4</para></cell><cell width="20mm"><para></para></cell>
</row>
<row>
<cell width="20mm"><para>10/12/2002</para></cell><cell width="20mm"><para>1-0-1</para></cell><cell width="20mm"><para>1.3</para></cell><cell width="20mm"><para>Xerces2.1</para></cell><cell width="20mm"><para>Xalan2.4</para></cell><cell width="20mm"><para>1.1.3</para></cell><cell width="20mm"><para>4.0.4</para></cell><cell width="20mm"><para></para></cell>
</row>
<row>
<cell width="20mm"><para>08/11/2002</para></cell><cell width="20mm"><para>1-0-0</para></cell><cell width="20mm"><para>1.3</para></cell><cell width="20mm"><para>Xerces2.1</para></cell><cell width="20mm"><para>Xalan2.4</para></cell><cell width="20mm"><para>1.1.3</para></cell><cell width="20mm"><para>4.0.4</para></cell><cell width="20mm"><para></para></cell>
</row>
<row>
<cell width="20mm"><para>18/10/2002</para></cell><cell width="20mm"><para>0-9-11</para></cell><cell width="20mm"><para>1.3</para></cell><cell width="20mm"><para>Xerces2.1</para></cell><cell width="20mm"><para>Xalan2.4</para></cell><cell width="20mm"><para>1.1.3</para></cell><cell width="20mm"><para>4.0.4</para></cell><cell width="20mm"><para></para></cell>
</row>
<row>
<cell width="20mm"><para>16/10/2002</para></cell><cell width="20mm"><para>0-9-10</para></cell><cell width="20mm"><para>1.3</para></cell><cell width="20mm"><para>Xerces2.1</para></cell><cell width="20mm"><para>Xalan2.4</para></cell><cell width="20mm"><para>1.1.3</para></cell><cell width="20mm"><para>4.0.4</para></cell><cell width="20mm"><para></para></cell>
</row>
<row>
<cell width="20mm"><para>08/07/2002</para></cell><cell width="20mm"><para>0-9-9</para></cell><cell width="20mm"><para>1.3</para></cell><cell width="20mm"><para>Xerces1.3</para></cell><cell width="20mm"><para>Xalan2.1</para></cell><cell width="20mm"><para>1.1.3</para></cell><cell width="20mm"><para>-</para></cell><cell width="20mm"><para></para></cell>
</row>
<row>
<cell width="20mm"><para>06/07/2002</para></cell><cell width="20mm"><para>0-9-8</para></cell><cell width="20mm"><para>1.3</para></cell><cell width="20mm"><para>Xerces1.3</para></cell><cell width="20mm"><para>Xalan2.1</para></cell><cell width="20mm"><para>1.1.3</para></cell><cell width="20mm"><para>-</para></cell><cell width="20mm"><para></para></cell>
</row>
<row>
<cell width="20mm"><para>20/12/2001</para></cell><cell width="20mm"><para>0-9-7</para></cell><cell width="20mm"><para>1.3</para></cell><cell width="20mm"><para>Xerces1.3</para></cell><cell width="20mm"><para>Xalan2.1</para></cell><cell width="20mm"><para>1.1.3</para></cell><cell width="20mm"><para>-</para></cell><cell width="20mm"><para></para></cell>
</row>
<row>
<cell width="20mm"><para>12/12/2001</para></cell><cell width="20mm"><para>0-9-6</para></cell><cell width="20mm"><para>1.3</para></cell><cell width="20mm"><para>Xerces1.3</para></cell><cell width="20mm"><para>Xalan2.1</para></cell><cell width="20mm"><para>1.1.3</para></cell><cell width="20mm"><para>-</para></cell><cell width="20mm"><para></para></cell>
</row>
<row>
<cell width="20mm"><para>04/12/2001</para></cell><cell width="20mm"><para>0-9-5</para></cell><cell width="20mm"><para>1.3</para></cell><cell width="20mm"><para>Xerces1.3</para></cell><cell width="20mm"><para>Xalan2.1</para></cell><cell width="20mm"><para>1.1.3</para></cell><cell width="20mm"><para>-</para></cell><cell width="20mm"><para></para></cell>
</row>
<row>
<cell width="20mm"><para>21/06/2001</para></cell><cell width="20mm"><para>0-9-1</para></cell><cell width="20mm"><para>1.3</para></cell><cell width="20mm"><para>Xerces1.3</para></cell><cell width="20mm"><para>Xalan2.0</para></cell><cell width="20mm"><para>-</para></cell><cell width="20mm"><para>-</para></cell><cell width="20mm"><para></para></cell>
</row>
<row>
<cell width="20mm"><para>13/06/2001</para></cell><cell width="20mm"><para>0-9-0</para></cell><cell width="20mm"><para>1.3</para></cell><cell width="20mm"><para>Xerces1.3</para></cell><cell width="20mm"><para>Xalan2.0</para></cell><cell width="20mm"><para>-</para></cell><cell width="20mm"><para>-</para></cell><cell width="20mm"><para></para></cell>
</row>
<row>
<cell width="20mm"><para>22/05/2001</para></cell><cell width="20mm"><para>20010522</para></cell><cell width="20mm"><para>1.3</para></cell><cell width="20mm"><para>Xerces1.3</para></cell><cell width="20mm"><para>Xalan2.0</para></cell><cell width="20mm"><para>-</para></cell><cell width="20mm"><para>-</para></cell><cell width="20mm"><para></para></cell>
</row>
</table>
</sect1>
</chapter>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Id: dev.xml,v 1.1 2003-04-09 14:22:36 triolet Exp $-->
<chapter id="dev" type="appendice" previous="gui" next="contrib">
<title>Developing with Transmorpher</title>
<para>This appendice is targeted to those who want to program with Transmorpher.
The installation procedure is that decribed above</para>
<sect1>
<title>Applying the test suite</title>
<para>In order to apply the test suite, you will need junit and ant. Just go to the script directory
and apply:</para>
<code>$ sh ant test</code>
</sect1>
<sect1>
<title>Compiling Transmorpher</title>
<para>In order to re-compile transmorpher you will need a Java compiler and ant. Just go to the script
directory and apply:</para>
<code>$ sh ant compile</code>
<para>or, if you want to use this compiled code in a regular way:</para>
<code>$ sh ant jar</code>
<para>Have a look at the build.xml file for more options or type:</para>
<code>$ sh ant usage
Buildfile: build.xml
init:
[echo] Transmorpher build for version 0-9-10running of 11/10/2002
usage:
[echo] sh ant _target_ _options_
[echo]
[echo] usage: this message
[echo] init: sets necessary variables
[echo] compile: incrementaly compiles sources
[echo] compileall: recompiles all sources
[echo] jar: archives compiled code
[echo] test: performs unit tests
[echo] updatetests: update the tests skeletons
[echo] javadoc: generates documentation
[echo] update: update the CVS repository
[echo] commit:
[echo] prepare: prepare the base for a release (VERSION variable set)
[echo] mark: set the tag on the version in the CVS base
[echo] image: prepage the release directory
[echo] package: create compressed releases
[echo] tidy: suppresses temporary files
[echo] ttask: test Transmorpher as a Ant task
[echo] release: releases a new version
[echo] cdrom: prepare the CDROM image for INRIA
[echo] clean: clean-up the release directory
[echo]
[echo] -Dversion=0-9-10running
BUILD SUCCESSFUL
Total time: 5 seconds</code>
</sect1>
<sect1>
<title>Extending Transmorpher</title>
<para>Transmorpher can be extended by adding new implementations of Transmorpher components. The "theoretical"
way to proceed is described in the Extension API subsections.</para>
<para>Extensions share a parameter attribute that they can access for getting the value of their parameters through
the fr.fluxmedia.transmorpher.Utils.Parameters interface.</para>
<para>The extensions must be declared for being taken into account by Transmorpher.This declaration can be made
either by providing the full class name of the extension:</para>
<code><![CDATA[<call type="my.class.path.Extension"/>]]></code>
<para>or by declaring the extension:</para>
<code><![CDATA[<defextern name="ext" class="my.class.path.Extension" type="call"/> ... <call type="ext"/>]]></code>
<para>You are encouraged to take inspiration from the standard implementations found in the stdlib package and the
contributed modules described here.</para>
</sect1>
<sect1>
<title>Manipulating Transmorpher</title>
<para>Transmorpher can be manipulated, e.g., for embedding in other software, through the manipulation API.</para>
<para>Good example of manipulation can be found in the sources of Transmorpher. The API has been briefly described in
this manual. Some more information can be found in the javadoc and the sources.</para>
</sect1>
</chapter>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Id: dispatch.xml,v 1.1 2003-04-09 14:22:36 triolet Exp $-->
<chapter id="dispatch" type="chapter" previous="generators" next="import">
<title>Dispatchers and Mergers</title>
<sect1>
<title>Dispatcher</title>
<para>The dispatcher is an element that has one input and many outputs. It can be used for
broadcasting the input to several channels or to selectively separate some elements from others.
</para>
<sect2>
<title>XML Declaration</title>
<para>The <element>dispatch</element> element introduces the use of a dispatcher in a process body. Its structure is the following: </para>
<para><code><![CDATA[
<dispatch type="type" id=" id " in="channel" out="channels">
{ <with-param> }*
</dispatch> ]]></code></para>
</sect2>
<sect2>
<title>Built-in dispatchers</title>
<para>Transmorpher provides a basic implementation of a dispatcher ( <element>broadcast</element> ), its behavior is to copy the input
to the different outputs. It is used in the bibliography example for dispatching the input: </para>
<para><code><![CDATA[
<dispatch type="broadcast" id="dispatch 2" in="R112" out="D1 D3"/>
<dispatch type="broadcast" id="dispatchStripped" in="X1" out="X11 X12"/>]]></code></para>
<figure id="dispatch" src="../refman/images/DispatchBasic.jpg" legende="Basic dispatcher"/>
<para>Transmorpher provides an other implementation of a dispatcher (<element>TestingDispatcher</element>), its behavior is to send the input to the first ouput
if test==value, to the other if test!=value: </para>
<para><code><![CDATA[
<dispatch type="if" id="ifdispatch" in="IN" out="then else">
<with-param name="test">a<with-param>
<with-param name="value">b<with-param>
</dispatch> ]]></code></para>
<para>References to contributed generators can be found here [ADD LINK]</para>
</sect2>
<sect2>
<title>Manipulation API</title>
</sect2>
<sect2>
<title>Extension API</title>
<para>
One can imagine more complex dispatchers. In the bibliography example, a dispatcher could split the reference
elements into a regular list of references and the list of authors. This can be useful for generating a list of
authors (sorted and <element>uniq</element> 'ed) or an index. In the transformation of this paper from XML to HTML, we could have
separated the <element>graphic</element> elements from the rest of this paper in order to transform the TIFF pictures into JPEG. </para>
<figure id="complexdispatch" src="../refman/images/DispatchComplex.jpg" legende="Complex dispatcher"/>
<para>
Implementing new dispatchers can be achieved by extending the <element>fr.fluxmedia.transmorpher.engine.TDispatcher</element>
class. This class extends the <element>org.xml.sax.ContentHandler</element> interface which must be implemented in your class. This means
that the SAX events arriving by the input channel must be handled by the new class.</para>
<para>Moreover, the class will have to communicate to the handlers that implements the output channels the SAX events
that you want to send to them (at least, <element>startDocument</element>. and <element>endDocument</element> ). These content handlers are found in the
contentHandlers variable (the content handler corresponding to output of rank <em>i</em> by <element>contentHandlers[i]</element>). </para>
</sect2>
</sect1>
<sect1>
<title>Mergers</title>
<para>The merger is a process that has several inputs and one output.
</para>
<sect2>
<title>XML Declaration</title>
<para>The <element>merge</element> element introduces the use of a merger in a process body. Its structure is the following: </para>
<para><code><![CDATA[
<merge type="type" id="id" in="channels" out="channel">
{ <with-param> }*
</merge> ]]></code></para>
</sect2>
<sect2>
<title>Built-in mergers</title>
<para>Transmorpher provides two simple built-in mergers. <element>concat</element> is a simple merger that copies all the 2..n channels
under the root element of the first channel (preserving order). This merger is used in the bibliography example for
merging two source XML documents: </para>
<para><code><![CDATA[
<merge type="concat" id="merge" in="R1 R2" out="R3"/> ]]></code></para>
<figure id="basicmerger" src="../refman/images/ConnectorBasic.jpg" legende="Basic merger"/>
<para>
A second merger, <element>wrap</element>, wraps the tree corresponding of all its input channels under a wrapping tag which will be the root element of
the output channel. It thus takes a tag parameter containing the name of this root element. </para>
<para>References to contributed generators can be found here [ADD LINK]</para>
</sect2>
<sect2>
<title>Manipulation API</title>
</sect2>
<sect2>
<title>Extension API</title>
<para>One can imagine more complex mergers. For instance, in the bibliography example, one can define a merger
which merges a channel of titles with a channel of authors to produce a channel of references. </para>
<figure id="complexmerger" src="../refman/images/ConnectorComplex.jpg" legende="Complex merger"/>
<para>New mergers must extend the <element>fr.fluxmedia.transmorpher.engine.TMerger</element> class. This class must provide
handlers for handling input channels and send resulting SAX events to the handler of the output channel.
[TO BE COMPLETED, THIS IS MORE COMPLICATED]. </para>
</sect2>
</sect1>
</chapter>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Id: dtd.xml,v 1.1 2003-04-09 14:22:36 triolet Exp $-->
<chapter id="dtd" type="appendice" previous="depend" next="gui">
<title>document type descriptions</title>
<para>The actual DTD can be found at: http://transmorpher.inrialpes.fr/dtd/ [LINK]</para>
</chapter>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Id: examples.xml,v 1.1 2003-04-09 14:22:36 triolet Exp $-->
<chapter id="examples" type="chapter" previous="introduction" next="model">
<title>Examples</title>
<sect1>
<title>New example : Discographie and gigs</title>
<para></para>
<sect2>
<title>Data</title>
<para>We have a DTD which describes a music collection. <element>Artist</element> elements may contain
several albums with informations on each track.</para>
<para>Our objective is to build an HTML representation of this collection :</para>
<list>
<item><para>An HTML presentation for the whole collection</para></item>
<item><para>An HTML presentation for an artist</para></item>
<item><para>A list</para></item>
</list>
<code><![CDATA[<?xml version="1.0"?>
<!DOCTYPE music-collection SYSTEM "Music-collection.dtd">
<music-collection>
<owner>Tom</owner>
<artist>
<name>Dido</name>
<cd category="pop" year="2001" tracks="12">
<title>No Angel</title>
<track id="1"><name>Here With Me</name><time>4:15</time></track>