Transmorpher


Start with the transmorpher (user) (programer)


0) Objectives :

In electronic documentation, the notion of a transformation is common. It is a process which transform a document, the source, into another, the target. This notion spreads to the whole computing discipline with the advent of the \xml\ language. We consider here these transformations from a broader point of view where the language is an \xml\ extended with sub-typing (like might be \xml-Schema) and provided with a denotational semantics.

Moreover, the computer systems being interconnected, it is straightforward to compose transformations and assemble them in a transformation graph. Such a graph, when restricted to one source and one target, can be seen in turn as a transformation. If the properties of elementary transformations in the graph are known, it is not straight forward to establish those of the graph as a transformation. But these are the kind of garanties that an information system architext would like to establish.
 

    1) Run the samples :)
          Read the description of the sample (see sample) :
          Sample 1 : this is a simple transormation (see Sample 1 )
          Sample 2 : this is a simple transformation with a query (see Sample 2 )
          Sample 3 : this is a more complex transformation (see Sample 3 )
         Have a look on performance analysis (see performance) :

    2) What can you do :
            - use predifine basic process
            - define your own complexe process with existing basic process
            - define rule set to avoid writing XSL file for simple transformation but complexe XSL writting
            - extend existing XSL file with rule

    2.1) Use pre-defined basic processes

    Basic connector 1..n ->  1:
       The connector is an element which have many XMLflow input, and one XMLFlow output.
       This process copy all the 2..n XML flow inside the root element of the first XML Flow. We can imagine more complexe Connector. For exemple, in the Bibliography sample, we can define a connector which merge a XML flow of Title, with a XML Flow or author to produce an XML Flow of Reference.
     

    simple Conncetor

    Complex connector

    Basic Generator 0 -> 1 :
    The generator is an element which have no input XMLflow, and One Output XMLFlow. The basic comportement of a Generator is to  read a XML file and produce an XML data flow.
    We can imagine more complex generator : for example, it can be a program which produce a set of XMLFlow, or a parser which deliver the content of the XMLFile, on different flow, according to the element name.
     

    Simple Generator

    Complex Generator

    Basic dispatcher 1 -> n
     

      The dispatcher is a element which have one XMLFlow Input and many XMLFlow Output.
      The transmorpher provide a basic implementation of an Dispatcher element, its comportement is to copy the input XML flow to the differents output. We can imagine more complex dispatcher. It the bibliography sample, a dispatche can split the reference element in many XMLFLow. It can be usefull if we want to print a list of author, a list of book, a list of title, ...

    Basic Serialiser 1 -> 0 :
        The serialiser is a process that have in input an XMLflow, and no output. The process write the XML flow in a file. Currently the file format support is HTML / XML / PlainText. We Can imagine more complex serializer, for example, we can produce stastistique about the publication of an author, and the serialiser can produce an SVG representation of the data, or convert the SVG information into image format (jpg, gif, ..).
     

    RuleSet  1 -> 1 :
      A rule set is a set of basics transmormations (which can extend a set of transformations defined in XSL file).
      The RuleSet process  apply the rule set to an XML File, so it takes a XML flow in input and produce an XML flow in output.

    Xalan Transformer : 1 -> 1
       Apply the XSL file to the XML FLow using xalan processor.

    Saxon Transformer : 1-> 1
       Not yet implemented :-)

    BasicQuerry  1 -> 1 :
       Apply the querry to the XML flow, and ouput the result of the querry. This fonctionnality is usefull to select node (or type of node), in a xml flow.
       Currently, the querry langage is quite simple, it will be interrestring to extend it (or use sql querry as querry langage).

    LoopElement n->n :
        Apply a process X times or until a property is true.
        this process element is usefull to realise closure operations.

    2.2) Define your own process : agregate a set of basic processes :

    All this definition occure in the process file

    To define your own complex process you must :
       - define process with the different basic element (see processDTD & basic element )
         to know the basic comportment of basic element see BasicComportment
       - define the main element which describe the process flow (see processDTD).
     

    2.3) Define rule set

        At the begining of the process file you can define ruleset if needed according to the ruleset syntax (see processDTD  and ruleset )
        Why use rule set  :
           In the bibliography sample, if we want to strip the abstrac information, with the XSL approach we must define a XsL file (see StripAbstract.xsl), this definition is quite complex to only delete an element. The transmorpher allow easy definition of such transformation(see StripAbstractRuleSet).
     
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!-- DOCTYPE xsl:stylesheet SYSTEM ""-->

    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:bib="http://exmo.inrialpes.fr/papers">

    <xsl:output   method="xml"   version="1.0"   encoding="iso-8859-1"
      omit-xml-declaration="no"   standalone="no"    indent="yes" doctype-system="http://exmo.inrialpes.fr/papers/xml/bib.dtd"/> 

    <!-- toplevel -->
    <xsl:template match="/">
     <xsl:apply-templates/>
    </xsl:template>

    <xsl:template match="bibliography">
    <bibliography name="{@name}" date="{@date}">
     <xsl:apply-templates select="reference"/>
    </bibliography>
    </xsl:template>

    <xsl:template match="*|@*|text()">
     <xsl:if test="not(@status='hidden')">
      <xsl:copy>
       <xsl:apply-templates select="*|@*|text()"/>
      </xsl:copy>
     </xsl:if>
    </xsl:template>

    <xsl:template match="abstract|keywords|areas|softwares|contracts"/>
    </xsl:stylesheet>

    StripAstract.xsl

       <defineRuleSet name="stripAbstract"> 
           <remtag match="abstract|keywords|areas" content="reference"/>
           <remtag match="*[status='hidden']" content="reference"/> 
      </defineRuleSet>
     
     
























    StripAbstract ruleSet

    Figure Strip abstract





    2.4) Extend XSL File

        The rule set definition allow the user to extend an XSL file. This extension may overwrite some rules in the XSL file without warning; be carefull.