Tralics, a LaTeX to XML translator; Part II

6. Converting XML to HTML

The Inria´s scientific activity report is constructed from contributions by the research teams. Each team writes a LaTeX file converted to XML by Tralics (or writes it directlty in XML); the file is formed of a number of modules, grouped by sections, and each module is transformed into a HTML page. Each module can be read independently of all others; hence it should be possible to take modules from different teams, and group them in a single page (dynamic version of the RA). On the other hand, the home page of each team has a link to its activity report, formed of these modules, chained in some order (static version of the RA).

The raweb package provides two style sheets that produce HTML from an XML source, they are called dynamic.xsl and static.xsl. The static version is described here, it constructs the document. This is the start of the file.

601 <xsl:stylesheet
602   xmlns:xsl="" version="1.0"
603   xmlns:m=""
604   xmlns:xlink=""
605   xmlns:html=""
606   exclude-result-prefixes="m html xlink" >

Some years ago, it was decided to add the notion of `topic´. If a team has three main research subjects, each one will be a topic. Thus, a module is associated to a topic and a section, and the reader might want to read the document in section order or in topic order. For this reason, if topics are given, the document is translated twice, the only difference being how individual pages are linked together. The file Topic.xsl contains code to be executed when topics are present, the file sansTopic.xsl contains code for the case without topics, and biblio.xsl contains code for the bibliography. Finally, all other template rules are in common.xsl if they apply as well to the static and non-static case, or are in static.xsl or dynamic.xsl.

607   <xsl:import href="common.xsl"/>
608   <xsl:import href="Topic.xsl"/>
609   <xsl:import href="sansTopic.xsl"/>
610   <xsl:import href="biblio.xsl"/>

6.1. Common code for HTML conversion

We describe here the code that is either in static.xsl or common.xsl. We start with some boolean variables. These are defined in the imported file.

611   <xsl:param name="noframe" select="'0'" />
612   <xsl:param name="notoc" select="'0'" />
613   <xsl:param name="isTopic" select="'0'" />
614   <xsl:param name="xyleme" select="'0'" />

These are defined in the main file. The variable $xyleme is set to true in the dynamic version, to false in the static version. The variable $isTopic is true if we have topics (it will be set from outside the style sheet). The variable $noframe is true if there are no frames (this is the case of the dynamic version); some years ago there were three frames: navigation buttons, TOC and main text, in the current version, there are only two frames, the TOC on the left, the main text of the right. The variable $notoc controls whether a TOC should be inserted on each page, assuming that there is no separate frame with the TOC; finally, $allHtml is set in the case where the team produces it activity report in HTML, case there conversion from XML to HTML should be inhibited.

615   <xsl:param name="xyleme"  select="'0'"/>
616   <xsl:param name="noframe" select="'0'" />
617   <xsl:param name="notoc"   select="'0'" />
618   <xsl:param name="isTopic" select="'0'" />
619   <xsl:param name="allHtml" select="'0'" />

A very important point is the difference between a `Project-Team´ and a `Team´. Of the 160 teams that have written a RA in 2004, 110 were Projects (Research-teams recognized as project-team by INRIA, according to the web) at the start of the year. This code uses the isproject attribute of <identification>.

620 <xsl:variable name="LeTypeProjet">
621   <xsl:if test='/raweb/identification/@isproject="false"'>Team</xsl:if>
622   <xsl:if test='/raweb/identification/@isproject="true"'>Project</xsl:if>
623 </xsl:variable>

The main file defines the same variable differently.

624 <xsl:variable name="LeTypeProjet">
625  <xsl:choose>
626   <xsl:when test='/raweb/identification/@isproject="true"'>Project-Team</xsl:when>
627   <xsl:otherwise>Team</xsl:otherwise>
628  </xsl:choose>
629 </xsl:variable>

The variable $LeProjet contains the name of the team and $DirectoryPasTop contains the directory of the version without topics.

630 <xsl:variable name="LeProjet" select="/raweb/identification/@id"/>
631 <xsl:variable name="DirectoryPasTop" select="$LeProjet"/>

More variables, defining essentially paths.

632 <xsl:variable name="indexPath">../index.html</xsl:variable>
633 <xsl:variable name="iconspath" select="'../icons'" />
634 <xsl:variable name="imgpath" select="'../'" />
635 <xsl:variable name="helpdir"  select="'..'" />
636 <xsl:variable name="javadir"  select="'..'" />
637 <xsl:param name="displaycd" />

This templates adds a target attribute to the current element, unless the value of the parameter $theTarget is empty. It is useful if the current element is an anchor.

638 <xsl:template name="targetAttrib">
639   <xsl:param name="theTarget" />
640   <xsl:if test="$theTarget!=''">
641     <xsl:attribute name="target"><xsl:value-of select="$theTarget" /></xsl:attribute>
642     </xsl:if>
643 </xsl:template>

These three variables are target attributes, used as parameters of the template above.

644 <xsl:variable name="MainwindowTarget" select="'mainraweb06'" />
645 <xsl:variable name="AltwindowTarget"  select="'_alt'" />
646 <xsl:variable name="TopwindowTarget"  select="'_top'" />

In order to make this document a bit shorter, we have introduced the following templates.

647 <xsl:template name="targetAttrib.alt">
648   <xsl:call-template name="targetAttrib">
649     <xsl:with-param name="theTarget" select="$AltwindowTarget" />
650   </xsl:call-template>
651 </xsl:template>
653 <xsl:template name="">
654   <xsl:call-template name="targetAttrib">
655     <xsl:with-param name="theTarget" select="$TopwindowTarget" />
656   </xsl:call-template>
657 </xsl:template>
659 <xsl:template name="targetAttrib.main">
660   <xsl:call-template name="targetAttrib">
661     <xsl:with-param name="theTarget" select="$MainwindowTarget" />
662   </xsl:call-template>
663 </xsl:template>

The variable $year contains the current year or a default value. It is used to construct $FTPDirectory, the web location of the Activity Report.

664 <xsl:variable name="year">
665  <xsl:choose>
666    <xsl:when test='/raweb/@year'>
667      <xsl:value-of select="/raweb/@year"/>
668    </xsl:when>
669    <xsl:otherwise>2006</xsl:otherwise>
670  </xsl:choose>
671 </xsl:variable>
672 <xsl:variable name="FTPDirectory"
673   select="concat('', $year,'/',$LeProjet)"/>

This line is useless: all pages are created via <xsl:document>, and use `xhtml´ as document type.

674  <xsl:output method='html' encoding='iso-8859-1'
675   doctype-public='-//W3C//DTD HTML 4.0//EN'/>

6.1.1. The main translation rule

The toplevel element is <raweb>, it is translated according to the following rule. The variable $allHtml when set to one, inhibits translation, assuming that the HTML version of the document has been produced by other means.

676 <xsl:template match="/raweb">
677   <xsl:choose>
678     <xsl:when test="$allHtml='1'"/>
679     <xsl:otherwise>
680 ...
681     </xsl:otherwise>
682   </xsl:choose>
683 </xsl:template>

The global action is rather obvious: we call a routine for the title page, one for the presentation, one for each subsection of every main subsection, and one for the bibliography.

684   <xsl:apply-templates select="identification" mode="statique"/>
685   <xsl:apply-templates select="identification/team"  mode="statique"/>
686   <xsl:for-each select="presentation|fondements|domaine|logiciels|
687           resultats|contrats|international|diffusion">
688      <xsl:for-each select="subsection">
689         <xsl:apply-templates select="."  mode="statique"/>
690      </xsl:for-each>
691   </xsl:for-each>
692   <xsl:for-each select="biblio">
693         <xsl:apply-templates select="."  mode="statique"/>
694   </xsl:for-each>

In each case, a HTML page is constructed. We start with the easy case: the bibliography. The resulting page is in the directory defined by $Directory and is named bibliography.html.

695 <xsl:template match="biblio" mode="statique">
696   <xsl:document href="{$Directory}/bibliography.html"
697      indent="yes" method="xml"
698      doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
699      doctype-system="">
700     <html>
701       <xsl:apply-templates  select="." />
702     </html>
703   </xsl:document>
704 </xsl:template>

In the case of a <subsection>, we distinguish between sections of level one (originally called <module>) or below (<div2>, <div3>, etc.). This piece of code handles only modules, so that the test is useless: the `otherwise´ is not used.

705 <xsl:template match="subsection" mode="statique">
706  <xsl:choose>
707   <xsl:when test="not(parent::subsection)">
708     <xsl:document href="{$Directory}/{./@id}.html"
709       method="xml"  indent="yes" encoding="iso-8859-1"
710       doctype-public='-//W3C//DTD XHTML 1.0 Transitional//EN'
711       doctype-system="">
712       <html>
713         <xsl:apply-templates  select="." />
714       </html>
715     </xsl:document>
716   </xsl:when>
717   <xsl:otherwise>
718     <html>  <xsl:apply-templates  select="." /> </html>
719   </xsl:otherwise>
720  </xsl:choose>
721 </xsl:template>

The page with the composition of the team is the second page, it is constructed here, by applying a template to the <team> element.

722 <xsl:template match="identification/team" mode="statique">
723    <xsl:document href="{$Directory}/{@id}.html"
724       method="xml"  encoding="iso-8859-1" indent="yes"
725       doctype-public='-//W3C//DTD XHTML 1.0 Transitional//EN'
726       doctype-system="">
727     <html>
728        <xsl:apply-templates select="." />
729     </html>
730   </xsl:document >
731 </xsl:template>

Translation of the <identification> element consists of four HTML pages, one of them containing the team (previous rule). We show here how the three others are created. If the variable $noframe is true (there is some inconsistency here, let´s assume that the value is either one, meaning true, or zero, meaning false) we have no frames. If it is false, we have frames, one of them containing the text, the other containing the table of contents.

732 <xsl:template match="identification" mode="statique">
733   <xsl:if test="$noframe!='1'">
734     <xsl:call-template name="creer.frameset" />
735   </xsl:if>

We construct here the page containg the TOC (tdm in French). This is the only page that has no navigation buttons.

736     <xsl:document href="{$Directory}/{$LeProjet}_tdm.html"
737       method="xml" encoding="iso-8859-1" indent="yes"
738       doctype-public='-//W3C//DTD XHTML 1.0 Transitional//EN'
739       doctype-system="">
740       <html>
741         <xsl:call-template name="page.head" />
742         <body>
743           <xsl:call-template name="tdm" />
744         </body>
745       </html>
746     </xsl:document>

This is now the main page. Its name is uid0.html, the assumption being that the first ID generated by Tralics is `uid1´. Before 2005, the value of the variable $LeProjet was used instead. Thus adage2004/adage.html is now replaced by apics/uid0.html.

747     <xsl:document href="{$Directory}/uid0.html" method="xml"
748       indent="yes" encoding="iso-8859-1"
749       doctype-public='-//W3C//DTD XHTML 1.0 Transitional//EN'
750       doctype-system="">
751       <html>
752         <xsl:apply-templates select="." />
753       </html>
754     </xsl:document>
755   </xsl:template>

6.1.2. Creating pages

Converting XML to HTML is rather easy, compared to conversion into Pdf. The non-trivial point concerns the layout of the page, navigation buttons, meta data, etc. One question is: should we put navigation buttons on the top and bottom of the page? If a page is large, it can be interesting to have a `next´ button near the end, this avoids the need to scroll to the top, if you want to continue reading. Starting in 1995, the Raweb was produced by latex2html, which can conditionnaly insert navigation buttons(note: ); but this depends on the number of characters in the page, and not the effective size; as a consequence, the layout of the page seems to be random. The situation changed in 1999(note: ), the text is in a frame, and the navigation buttons are in an another frame, placed above the text; the buttons appear only in the first frame. In 2003(note: ) the situation changed again. There are two possible views. By default, there are no frames, but a button (the `TOC´ button) that creates two frames: the TOC on the left, the text on the right. The text has navigation buttons on the top and the bottom (but there are fewer buttons on the bottom). The same idea is used in 2004 and explained in this document. The first page of each Team contains a link to the previous and next year (when available). See figure 2.

Figure 1. The layout of a sample page for a Team without topics.
Figure 2. The layout of a sample page for a Project-Team with topics.

Here is a helper for producing an <img>. It takes two arguments $alt and $src. Icons are in a shared directory defined by $iconpath.

756 <xsl:template name="icon.image">
757   <xsl:param name="alt" />
758   <xsl:param name="src" />
759   <img align="bottom" border="0" alt="{$alt}" src="{$iconpath}/{$src}.gif />
760 </xsl:template>

The next command takes three arguments, $nom, $position, and $accesskey. If $nom is empty, the result is a simple image (for instance named next_motif_gr.gif, where `gr´ stands for `grey´ instead of black and white). Otherwise, it is the name of a HTML file, and the result is an anchor <a>, whose href attribute is this file name. The image is different (for instance named next_motif.gif, the images are designed so that it is obvious that they have the same purpose, one of them being active, the other inactive), but the alt field is the same; the accesskey(note: ) attribute is set only in this case. In any case, there is some white space after the button. Note: in certain cases, a anchor has a target attribute. This can be _alt (this is a name not recognised by the standard; the effect is that the browser opens a new window); this can be _top or _parent (these names are defined by the standard); it can also be mainraweb2004 (this is needed for links from the toc to the main frame). The buttons created by this procedure are in the main frame and point to the main frame; they have no target attribute.

761 <xsl:template name="make.icon">
762   <xsl:param name="nom" />
763   <xsl:param name="position" />
764   <xsl:param name="accesskey" />
765   <xsl:choose>
766     <xsl:when test="$nom=''">
767       <xsl:call-template name="icon.image">
768         <xsl:with-param name="alt" select="$position" />
769         <xsl:with-param name="src" select="concat($position,'_motif_gr')" />
770       </xsl:call-template>
771     </xsl:when>
772     <xsl:otherwise>
773       <a>
774         <xsl:attribute name='href'>
775            <xsl:call-template name="formaturl">
776              <xsl:with-param name="base" select="$nom" />
777            </xsl:call-template>
778         </xsl:attribute>
779         <xsl:if test="$accesskey!=''">
780           <xsl:attribute name="accesskey">
781             <xsl:value-of select="$accesskey" />
782           </xsl:attribute>
783         </xsl:if>
784         <xsl:call-template name="icon.image">
785           <xsl:with-param name="alt" select="$position" />
786           <xsl:with-param name="src" select="concat($position,'_motif')" />
787         </xsl:call-template>
788       </a>
789     </xsl:otherwise>
790   </xsl:choose>
791   <xsl:text>
793   </xsl:text>
794 </xsl:template>

The next piece of code creates five buttons, and two other items, and puts them in a <div>. The first three are created by make.icon; this is something that takes three arguments; in order to make this document shorter, we have indicated only the value of the parameters, the names being $nom, $position and $accesskey in order. In the same fashion, icon.image is called with two parameters, named $alt and $src, we show only the value. The three quantities $precedent, $suivant and $haut are arguments to the procedure. They refer to the previous page, next page and top page, which may exist or not; if the page exists, the button is in an anchor, otherwise it is just an image. The following buttons are anchors to `../adage2004/adage.pdf´ and `../adage2004/´, assuming that $year contains 2004, and $LeProjet contains `adage´. Since 2005, there is also an anchor to the XML file. These items are followed a link to the TOC and the javascript. Implementation details are given later.

The main Raweb location is, this contains a subdirectory for each year, for instance RA2004. In this directory, we have some common files and directories (the css, the icons, etc.), and the teams, for instance adage2004. For a HTML page under adage2004, the next page can be foo.html or ../adage2004/foo.html, the style sheet is in ../raweb.css.

Notes for the 2006 version. This document is written before the RA2006 is put on the web, so that the style sheets are not yet definitive. Nevertheless, it seems that the main directory for a team does not contain the year. Hence the Pdf file is in `../adage/adage.pdf´. In the code shown here, you will see the 2004 anchor, and later on the actual code used in 2006.

795 <xsl:template name="page.icons">
796   <xsl:param name="precedent" />
797   <xsl:param name="suivant" />
798   <xsl:param name="haut" />
799   <div class="NavigationIcones">
800     <xsl:call-template name="make.icon">("$precedent", "'previous'", "'P'")
801     </xsl:call-template>
802     <xsl:call-template name="make.icon">("$haut","'up'","'U'")
803     </xsl:call-template>
804     <xsl:call-template name="make.icon">("$suivant","'next'" ,"'N'")
805     </xsl:call-template>
806 <!--    Links to ps, pdf and xml... see below -->
807     <a href="../{$LeProjet}{$year}/{$LeProjet}.pdf"> ...</a>
808     <xsl:text>  </xsl:text>
809     <a href="../{$LeProjet}{$year}/{$LeProjet}.ps.gz"> ... </a>
810     <a href="../{$LeProjet}{$year}/{$LeProjet}.xml"> ... </a>
811     <xsl:call-template name="jg.toclink" />
812     <a id="toclink">...</a>
813     <java ... />
814   </div>
815 </xsl:template>

In the code above, we have a comment, followed by two links to the PostScript, Pdf, and XML versions of the document. In each case, we have lines like the following. We call some template with two arguments, the team name and some text (which is in fact a button, created by icon.image). The template is defined in the static and dynamic versions.

816    <xsl:call-template name="url-pdf-file">
817      <xsl:with-param name="projet" select="$LeProjet" />
818      <xsl:with-param name="Text">
819         <xsl:call-template name="icon.image"> ("'PDF'","'pdf_motif'")
820         </xsl:call-template>
821      </xsl:with-param >
822    </xsl:call-template>

This is the template called in the above code, static version. All three templates url-ps-file, url-pdf-file and url-xml-file are similar. The effect is to create an anchor, depending on the name of the team, containing the text. As you can see, the file name is ../adage/adage.pdf.

823 <xsl:template name="url-pdf-file">
824   <xsl:param name="projet" />
825   <xsl:param name="Text" />
826   <a href="../{$LeProjet}/{$LeProjet}.pdf"><xsl:copy-of select="$Text" /></a>
827   </xsl:template>

A similar procedure is used to create a link to the Team´s homepage. The anchor has a target attribute.

828 <xsl:template name="url-fiche-projet">
829   <xsl:param name="FicheProjetName" />
830   <xsl:param name="Text" />
831   <a href="{$FicheProjetName}.en.html" >
832     <xsl:call-template name="targetAttrib.alt" />
833     <xsl:copy-of select="$Text" />
834   </a>
835 </xsl:template>

The previous template is called twice. Here is the first occurence. The text is simply `Project-Team Apics´.

836 <xsl:template name="jg.url-fiche-projet-A">
837   <xsl:call-template name="url-fiche-projet-A">
838     <xsl:with-param name="FicheProjetName" select="$FicheProjetName" />
839     <xsl:with-param name="Text">
840       <xsl:value-of select="$LeTypeProjet" />:
841       <xsl:value-of select="/raweb/identification/shortname" />
842     </xsl:with-param>
843   </xsl:call-template>
844 </xsl:template>

Here is the second occurence. The text is `Presentation of the project´.

845 <xsl:template name="jg.url-fiche-projet-B">
846   <xsl:call-template name="url-fiche-projet">
847    <xsl:with-param name="FicheProjetName" select="$FicheProjetName" />
848    <xsl:with-param name="Text">
849      <xsl:choose>
850        <xsl:when test='/raweb/identification/@isproject="true"'>
851           Presentation of the project</xsl:when>
852        <xsl:otherwise>Presentation of the team</xsl:otherwise>
853      </xsl:choose>
854    </xsl:with-param>
855   </xsl:call-template>
856 </xsl:template>

The semantics of the Raweb says: a team name is formed of letters and digits; a name like pop_art is refused (this team did not exist when the rule was established). This rule was never changed, until January 2007 and version 2.9.4 (essentially because underscore characters are not always properly handled by LaTeX and Tralics). This implies that we must compute the real name (used by the procedure given above) and store it in a variable, say $FicheProjetName. Question: is there any reason why the template uses a parameter and not the global variable?

857 <xsl:variable name="FicheProjetName">
858  <xsl:choose>
859   <xsl:when test="string(/raweb/identification/@id)='popart'">pop_art</xsl:whn>
860   <xsl:when test="string(/raweb/identification/@id)='led'">langue_et_dialogue</xsl:when>
861   <xsl:when test="string(/raweb/identification/@id)='virtualplants'"
862      >virtual_plants</xsl:when>
863   <xsl:otherwise><xsl:value-of select="/raweb/identification/@id" /></xsl:otherwise>
864  </xsl:choose>
865 </xsl:variable>

The page contains an anchor, whose id is `toclink´, and whose href is something as complicated as `adage_tf.html?../adage2004/uid4.html´: after the question mark, there is the address of the current page, and before it is the name of the page with the frames.

866 <xsl:template name="jg.toclink.old">
867     <a id="toclink">
868        <xsl:attribute name="href">
869          <xsl:value-of select="$LeProjet"/>_tf.html?../<xsl:value-of
870              select="$LeProjet"/><xsl:value-of select="$year"/>/<xsl:value-of
871              select="@id"/>.html</xsl:attribute>
872        <img align="bottom" border="0" alt="Access to tdm"
873           src="../icons/contents_motif.gif" />
874     </a>
875 </xsl:template>

The code changed in 2006. If the variable $noframe is zero, meaning that we have frames, the anchor has `toclink´ as id, otherwise it does not. The class of the anchor depends also on this variable (but in all cases the value is the same, so that the test is not shown here). The content of the alt attribute was changed: the French abreviation TDM was replaced by the English equivalent TOC. Finally, the value of the link is computed by some piece of code.

876 <xsl:template name="jg.toclink">
877   <a>
878     <xsl:if test="$noframe='0'">
879       <xsl:attribute name="id">toclink</xsl:attribute>
880     </xsl:if>
881     <xsl:attribute name="class">toc</xsl:attribute>
882     <xsl:attribute name="href">
883        <xsl:call-template name="toclink" />
884     </xsl:attribute>
885     <img align="bottom" border="0" alt="Access to toc" >
886         src="{$iconspath}/contents_motif.gif" />
887   </a>
888 </xsl:template>

This constructs something like `adage_tf.html?../adage/uid4.html´, without the year. In the case of the main page, we use `uid0´ instead. The link to the TOC depends on whether topics are used or not. However, the code is the same: toclink_Topic is identical to toclink_sansTopic.

889 <xsl:template name="toclink_Topic">
890   <xsl:value-of select="$LeProjet" />
891   <xsl:text>_tf.html?../</xsl:text>
892   <xsl:value-of select="$LeProjet" />
893   <xsl:text>/</xsl:text>
894   <xsl:choose>
895     <xsl:when test="@id=$LeProjet">uid0</xsl:when>
896     <xsl:otherwise>
897       <xsl:value-of select="@id" />
898     </xsl:otherwise>
899   </xsl:choose>
900   <xsl:text>.html</xsl:text>
901 </xsl:template>

Then comes a javascript (it is defined in lib.js). The raweb.css file gives `display:none´ as property for the element identified by the toclink id. As a consequence, the button is invisible. However, if the name of the frame is `mainraweb2004´, the code on line 908 sets the `display´ style of elements with id `toclink´ to `inline´, so that the button is visible.

Assume that the button is visible, and you click on it. This will load the `adage_tf.html´ file; its content is explained later; all that you have to know is that the browser contructs a page with two frames, on the left the TOC, on the right is the current page (what follows the question mark); the name of this second frame is `mainraweb2004´, as a consequence the button is invisible. There are two modifications in 2006. The first one is that the frame name is now in the variable $MainwindowTarget. The second is that thare are options $noframe (if set, there are no frames, hence no possibility to switch) and $notoc (if set, there is no table of contents). In these cases, the java script is not executed.

902     <xsl:choose>
903       <xsl:when test="$noframe='0' and $notoc='0'" >
904         <script type="text/javascript">
905           <xsl:comment>
906            var cible=this.location;
907            if ( != "<xsl:value-of select="$MainwindowTarget" />")
908             changestyle('toclink','inline');
909            //</xsl:comment>
910         </script>
911       </xsl:when>
912     </xsl:choose>

The bottom of the page contains only two buttons: previous and next. We have used the same conventions as above. The parameters $precedent and $suivant contain the locations of the previous and next pages. We insert another item, a javascript. These three items are each in a <div>, with an id attribute, the raweb.css file says that these should be flushed left or right, or centered. There is a <br> element before and after these three <div> elements. There was also an empty <p>, removed in 2006.

913 <xsl:template name="pagedown.icons">
914     <xsl:param name="precedent" />
915     <xsl:param name="suivant" />
916     <xsl:comment>FIN du corps du module</xsl:comment>
917     <br/>
918     <div id="tail_agauche">
919       <xsl:call-template name="make.icon">("$precedent","'previous'","'P'")
920       </xsl:call-template>
921     </div>
922     <div id="tail_adroite">
923       <xsl:call-template name="make.icon"> ("$suivant","'next'","'N'")
924       </xsl:call-template>
925     </div>
926     <div id="tail_aucentre"> <xsl:call-template name="classeurlink2" /> </div>
927     <br />
928 </xsl:template>

The bottom of the page contains, between the previous and next button, a javascript <div> that reads: “You are interested in this page Put in folder !”.

929 <xsl:template name="classeurlink2">
930     <div class="folderLine">
931       <script type="text/javascript" src="{$javadir}/classeur/classeurInOut.js" />
932       <noscript><p>Using javascript allows access to folder</p></noscript>
933     </div>
934 </xsl:template>

The top of the page contains, on the right, a <div> element (whose color is a kind of blue, the raweb.css file says it is BCBCF9), with an image and a pointer to the help page for the folder. There is also a <script>, that allows you to put the current page in the folder (same action as on the bottom of the page), or to view and manipulate the folder.

935 <xsl:template name="classeurlink1">
936   <div class="folderButtons noscript">
937     <a id="folderIconRef" href="../classeur/aide.html">
938       <img id="folderIcon" src="{$iconspath}/folder.gif"
939            alt="icon of folder" border="0"/>
940     </a>
941     <script type="text/javascript" src="{$javadir}:classeur/classeurInOutShow.js" />
942   </div>
943   <noscript> Using JavaScript allows access to folder </noscript>
944 </xsl:template>

The middle part of the head of the page consists in two buttons vertically aligned (because of the <br>) in a <small> element(note: ). If you click on them, you get the help, and the index. On the right of these, you will find the search form.

945 <xsl:template name="head-middle">
946  <div id="head_aucentre">
947   <xsl:call-template name="formRechercheExalead" />
948   <a href="{$helpdir}/aide.html" target="aide" onclick="displayHelp(this)">HELP</a>
949    <br /> <br />
950    <a href="../index/index.html">
951       <xsl:call-template name="targetAttrib.alt" />
952       INDEX
953    </a>
954  </div>
955 </xsl:template>

This constructs the search <form>. We do not indicate here all the attributes, and the hidden fields.

956 <xsl:template name="formRechercheExalead">
957   <form ...>
958     Search in Activity Report, year <xsl:value-of select="$year" />:<br />
959     <input name="_q" size="20" maxlength="800" value=""/>
960   </form>
961 </xsl:template>

Another form. Why are two forms required? The search engine was AltaVista until July 2005, and Exalead after that. The version of the style sheet we present here is dated 2006/09/21. Apparently, this form is used, rather then the preceding one. The difference is tiny (of course, the result of the search engine is completely different, but this has nothing to do with the HTML input).

962 <xsl:template name="formRecherche">
963   <form id="recherche" ... >
964     <input name="q1" size="20" maxlength="800" value=""/>
965   </form>
966 </xsl:template>

At the very bottom of the page, we have the Inria logo and a link to Inria´s home page. The <div> and <span> elements have an id that is interpreted by the raweb.css style sheet.

967 <xsl:template name="bandeau_inria">
968   <div id="bandeau">
969     <a id="bandeau_logo" href="">
970        <span id="logotext" >Logo Inria</span>
971     </a>
972   </div>
973 </xsl:template>

This creates the top of the page. It takes four arguments, namely $precedent, $haut, $suivant, which are the names of the previous, up or next page, and $couleur. This last value is not a color, it is a symbolic name (it is `premiere´ or `autre´, French for `first´ and `other´) that will be added as class attribute to the main <div> element. This <div> element has three <div> children, that explain what should be put on the left, the middle, and the right of the page. We have already explained what is on the middle and the right. On the left, there are three lines, separated by <br>, using a <small> font. The first line contains something like “Inria / Raweb 2004”, with two links, the second line contains “Team: Adage”, with a link to the team´s home page (note that `Adage´ comes from <shortname>, and the link points to `adage´, that comes from $LeProjet). The last line contains the navigation buttons, created by page.icons (arguments are obvious, they are not indicated here, but replaced by a question mark).

974 <xsl:template name="bandeau-sup">
975   <xsl:param name="couleur"/>
976   <xsl:param name="precedent" />
977   <xsl:param name="haut" />
978   <xsl:param name="suivant" />
979   <div id="toplign">
980     <xsl:attribute name="class"><xsl:value-of select="$couleur" /></xsl:attribute>
981     <div id="head_agauche">
982      <small>
983       <a href="">
984         <xsl:call-template name="" />
985         Inria
986       </a> /
987       <a href="{$indexPath}">Raweb
988             <xsl:value-of select="$year" /></a>
989       <br />
990       <xsl:call-template name="jg.url-fiche-projet-A" />
991      </small>
992      <br />
993      <xsl:call-template name="page.icons"> (?,?,?)
994      </xsl:call-template>
995     </div>
996     <xsl:call-template name="head-middle" />
997     <div id="head_adroite"> <xsl:call-template name="classeurlink1" /> </div>
998   </div>
999 </xsl:template>

This piece of code constructs the start of a page. In order to make things easier to understand, we split the code in two parts. In the first part, we construct three variables. One contains the authors; this was used for the value dc.creator, but in the current version, there is one dc.creator per author, and the variable has become useless. The second variable contains the toplevel keywords, from <keyword>. The last variable contains the title, from <bodyTitle>, preceded by the section title (which is a bit more complicated to compute; this was added in 2006).

1000 <xsl:template name="page.head">
1001   <xsl:param name="title" />
1002   <xsl:variable name="MTAUT" />
1003   <xsl:variable name="MTMCL">
1004       <xsl:for-each select="./keyword">
1005         <xsl:apply-templates /> <xsl:text>/</xsl:text>
1006       </xsl:for-each>
1007   </xsl:variable>
1008   <xsl:variable name="MTDES">
1009     <xsl:if test="name()='identification'">
1010       <xsl:value-of select="projectName"/>
1011     </xsl:if>
1012     <xsl:if test="name()='biblio'"> <xsl:text>Bibliography</xsl:text></xsl:if>
1013     <xsl:if test="name()='team'">  <xsl:text>Members</xsl:text></xsl:if>
1014     <xsl:if test="name(..)='presentation' or  name(..)='fondements' or
1015         name(..)='domaine' or name(..)='logiciels' or name(..)='resultats'
1016         or name(..)='contrats' or  name(..)='international'
1017         or name(..)='diffusion'">
1018       <xsl:value-of select="../bodyTitle"/><xsl:text> - </xsl:text>
1019     </xsl:if>
1020     <xsl:value-of select="./bodyTitle" />
1021   </xsl:variable>

Action is trivial. The <title> of any HTML page produced by the Adage team in 2004 has the form “Team-Adage”, while dc.title contains the title of the module. Since 2006, a parameter $title was added, so that the title of the HTML page could be “Project-Team-Adage:Introduction”; this is strange in case the parameter is empty.

1022     <head>
1023       <title>
1024         <xsl:value-of select="$LeTypeProjet" />-<xsl:value-of
1025               select="/raweb/identification/shortname" />
1026          :<xsl:value-of select="$title" />
1027       </title>
1028       <link rel="Stylesheet" href="../raweb.css" type="text/css" />
1029       <meta name="description" content="{$MTDES}" />
1030       <meta name="dc.title" content="{$MTDES}" />
1031       <xsl:for-each select=".//person">
1032         <meta name="dc.creator">
1033            <xsl:attribute name="content">
1034               <xsl:value-of select="firstname"/>
1035               <xsl:text> </xsl:text>
1036               <xsl:value-of select="lastname" />
1037            </xsl:attribute>
1038         </meta>
1039       </xsl:for-each>
1040       <meta name="dc.subject" content="{$MTMCL}" />
1041       <meta name="dc.publisher" content="INRIA" />
1042       <meta name="" content="(SCHEME=ISO8601) 2004-01" />
1043       <meta name="dc.type" content="Report" />
1044       <meta name="dc.language" content="(SCHEME=ISO639-1) en" />
1045       <meta name="projet">
1046         <xsl:attribute  name="content">
1047            <xsl:value-of  select="/raweb/identification/shortname" />
1048         </xsl:attribute>
1049       </meta>
1050       <xsl:call-template name="classeurDecl"/>
1051       <xsl:call-template name="interrogationDecl"/>
1052       <script type="text/javascript" src="../lib.js"></script>
1053     </head>
1054   </xsl:template>

This declares the three javascripts.

1055 <xsl:template name="interrogationDecl">
1056     <script type="text/javascript" src="{$javadir}/interro.js" />
1057 </xsl:template>
1058 <xsl:template name="classeurDecl">
1059     <script type="text/javascript"  src="{$javadir}/classeur/classeur.js" />
1060     <script type="text/javascript"  src="{$javadir}/lib.js" />
1061 </xsl:template>

We generate one HTML page for each module, one for the composition of the team (that comes before the first module), and one for the bibliography that comes last. The first page (the title page) will contain the full table of contents. Since 2006, the code is split in two parts; two templates are used for each page, the first has already been described, and we show now the second one, whose objective is to produce the <head> and <body> of the <html> part of the page.

There is a possiblity to generate the Raweb without frames ($noframe is true). In general, one frame contains the text and the other one the TOC, thus, in the case of a single frame, there is no direct access to the TOC. For this reason if $notoc is false, a copy of the table of contents is added at the start of every page (except the main page that contains the full TOC).

1062 <xsl:template name="jg.toc">
1063   <xsl:if test="$noframe='1' and $notoc='0'">
1064     <xsl:call-template name="tdm" />
1065   </xsl:if>
1066 </xsl:template>

For the first page, the links to the top and previous pages are identical, they point to the title page (uid0.html), the link to the next page is to the first <subsection> (the name of the page is the id attribute, with a `.html´ extension). In order to reduce the size of this document, we do not show the parameters to bandeau-sup and pagedown.icons, the value is obvious, it is replaced by a question mark. The page.head template takes a title parameter, not shown here, it is empty.

We have explained above how page headers and footers are created, let´s explain here how the body is constructed. First, we extract all <moreinfo> elements that come from this element or the <identification> part, they are output in a <blockquote> element. After that, we insert the title in a <h1> heading. This is followed by all the <participants> elements; each such element has a category attribute, that gives a subtitle, a <h3> element. We convert underscores back to spaces. Each <person> of these participants is inserted, with a <br> as separator.

1067 <xsl:template match="identification/team">
1068   <xsl:variable name="precedent" select="'uid0'" />
1069   <xsl:variable name="haut" select="'uid0'" />
1070   <xsl:variable name="suivant" select="/raweb/*/subsection[1]/@id" />
1071   <xsl:call-template name="page.head" />
1072   <body>
1073     <xsl:call-template name="jg.toc"/>
1074     <xsl:call-template name="bandeau-sup">
1075       <xsl:with-param name="couleur" select="'autre'" /> (?,?,?)
1076     </xsl:call-template>
1077     <div id="main">
1078       <xsl:for-each select="/raweb/identification/moreinfo">
1079         <blockquote> <xsl:apply-templates /> </blockquote>
1080       </xsl:for-each>
1081       <xsl:for-each select="./moreinfo">
1082           <blockquote> <xsl:apply-templates /> </blockquote>
1083       </xsl:for-each>
1084       <h1>Team</h1>
1085       <xsl:for-each select="participants">
1086         <h3> <xsl:value-of select="translate(@category, '_', ' ')" /> </h3>
1087         <xsl:for-each select="person">
1088            <xsl:apply-templates select="." />  <br />
1089           </xsl:for-each>
1090       </xsl:for-each>
1091       <br />
1092       <xsl:call-template name="pagedown.icons"> (?,?)
1093       </xsl:call-template>
1094       <xsl:call-template name="bandeau_inria"/>
1095     </div>
1096   </body>
1097 </xsl:template>

This constructs the page with the bibliography.

1098 <xsl:template match="biblio">
1099   <xsl:variable name="precedent"
1100        select="preceding-sibling::*[1]/subsection[position()=last()]/@id"/>
1101   <xsl:variable name="haut" select="'uid0'"/>
1102   <xsl:variable name="suivant" select="''"/>
1103      <xsl:call-template name="page.head"/>
1104      <body>
1105        <xsl:call-template name="jg.toc"/>
1106        <xsl:call-template name="bandeau-sup">(?,?,?)
1107           <xsl:with-param name="couleur" select="'autre'" />
1108        </xsl:call-template>
1109        <h1> Bibliography </h1>
1110        <xsl:call-template name="tri-par-publis"/>
1111        <xsl:call-template name="pagedown.icons"> (?,?)
1112        </xsl:call-template>
1113        <xsl:call-template name="bandeau_inria"/>
1114      </body>
1115 </xsl:template>

In the case of <subsection>, we have to distinguish between modules and normal sections. A module is a subsection whose parent is not a subsection, and a full HTML page must be created. In this case, we generate a page, like above (arguments of bandeau-sup and pagedown.icons are not shown, the non-trivial part is to find the previous and next pages, in $precedent and $suivant). The page body contains the following: it starts with a title (for instance “Team : adage” in a <h1>, followed by the title of the section (it could be “Section: Overall Objectives” in a <h2>, this depends on whether $isTopic is set), followed by a horizontal rule, a <hr>. This is followed by the title (value of <bodyTitle>) in a <h3> and the keywords(note: ). Then comes the content of the subsection.

1116 <xsl:template match="subsection">
1117  <xsl:variable name="haut" select="'uid0'" />
1118  <xsl:variable name="precedent"><xsl:call-template name="precedent" /> </xsl:variable>
1119  <xsl:variable name="suivant"><xsl:call-template name="suivant" /></xsl:variable>
1120   <xsl:choose>
1121    <xsl:when test="not(parent::subsection)">
1122      <xsl:call-template name="page.head" >
1123        <xsl:with-param name="title">
1124          <xsl:value-of select="./bodyTitle" />
1125        </xsl:with-param>
1126      </xsl:call-template>
1127      <body>
1128        <xsl:call-template name="jg.toc"/>
1129        <xsl:call-template name="bandeau-sup">(?,?,?)
1130          <xsl:with-param name="couleur" select="'autre'" />
1131        </xsl:call-template>
1132        <div id="main">
1133          <xsl:call-template name="use-id" />
1134          <h1>
1135            <xsl:value-of select="$LeTypeProjet" />
1136            <xsl:text> : </xsl:text>
1137            <xsl:value-of select="$LeProjet" />
1138          </h1>
1139          <xsl:choose>
1140            <xsl:when test="$isTopic='1'">
1141              <xsl:call-template name="section_title_Topic" />
1142            </xsl:when>
1143            <xsl:otherwise>
1144              <xsl:call-template name="section_title_sansTopic" />
1145            </xsl:otherwise>
1146          </xsl:choose>
1147          <hr />
1148          <xsl:apply-templates select="bodyTitle" mode="titre3"/>
1149          <xsl:call-template name="jg.keywords" />
1150          <xsl:apply-templates />
1151        <xsl:call-template name="pagedown.icons"> (?,?)
1152        </xsl:call-template>
1153        <xsl:call-template name="bandeau_inria"/>
1154        </div>
1155      </body>
1156    </xsl:when>

In the case where <subsection> is in a subsection, we output its title (value of <bodyTitle>) using <h4> or <h5>, depending on whether the parent is in a subsection, then the keywords, then the content.

1157    <xsl:otherwise>
1158      <xsl:call-template name="use-id" />
1159      <xsl:choose>
1160        <xsl:when test="(../parent::subsection)">
1161          <xsl:apply-templates select="bodyTitle" mode="titre5"/>
1162        </xsl:when>
1163        <xsl:otherwise>
1164           <xsl:apply-templates select="bodyTitle" mode="titre4"/>
1165        </xsl:otherwise>
1166      </xsl:choose>
1167      <xsl:call-template name="keywords-list" />
1168      <xsl:apply-templates />
1169    </xsl:otherwise>
1170   </xsl:choose>
1171 </xsl:template>

This piece of code creates the title page, the TOC, and the frameset. In the case of the adage team, the files are adage.html, adage_tdm.html, and adage_tf.html in the adage2004 directory. Let´s consider the title page first. It looks like a normal page, except that bandeau_inria (the banner with the logo) is before the text.

1172 <xsl:template match="identification">
1173   <xsl:variable name="precedent" select="''" />
1174   <xsl:variable name="haut" select="'uid0'" />
1175   <xsl:variable name="suivant" select="team/@id" />
1176   <xsl:call-template name="page.head" />
1177   <body>
1178     <xsl:call-template name="bandeau-sup">
1179       <xsl:with-param name="couleur" select="'premiere'" /> (?,?,?)
1180     </xsl:call-template>
1181     <xsl:call-template name="bandeau_inria"/>
1182     <xsl:comment>DEBUT du corps du module</xsl:comment>
1183     <xsl:call-template name="jg.titlepage"/>
1184     <hr class="rose"/>
1185     <xsl:call-template name="table.matieres" />
1186     <xsl:call-template name="pagedown.icons"> (?,?)
1187     </xsl:call-template>
1188  </body>
1189 </xsl:document>

The title page is divided in two parts, the first part contains the identification of the team, it is followed by the TOC. We start with a <h1> element that contains the full name of the team, from <projectName>. This is followed by the short name, from <shortname>. It is followed by “2006 research project activity reports”, a link to the UR (Research Unit), a link to the team, to the PostScript, Pdf and XML versions of the report.

1190 <xsl:template name="jg.titlepage"/>
1191   <h1 class="center"> <xsl:value-of select="projectName" /> </h1>
1192   <div class="entete">
1193     <div class="bigspace"><h2><xsl:value-of select="shortname" /></h2></div>
1194     <xsl:value-of select="$year" /> research project activity reports
1195     <xsl:call-template name="UR"/>
1196     <div class="bigspace">
1197       <xsl:call-template name="jg.find-theme"/>
1198     </div>
1199     <xsl:call-template name="jg.url-fiche-projet-B" />
1200     <xsl:call-template name="url-ps-file">
1201       <xsl:with-param name="projet" select="$LeProjet" />
1202       <xsl:with-param name="Text">PostScript</xsl:with-param>
1203     </xsl:call-template>
1204     <xsl:text>, </xsl:text>
1205     <xsl:call-template name="url-pdf-file">
1206       <xsl:with-param name="projet" select="$LeProjet" />
1207       <xsl:with-param name="Text">PDF</xsl:with-param>
1208     </xsl:call-template>
1209     <xsl:text> or </xsl:text>
1210     <xsl:call-template name="url-xml-file">
1211       <xsl:with-param name="projet" select="$LeProjet" />
1212       <xsl:with-param name="Text">XML</xsl:with-param>
1213     </xsl:call-template>
1214     <xsl:text> format</xsl:text>
1215   </div>
1216 </xsl:template>

This is the piece of code that inserts the theme, a bit arranged for clarity. It depends on whether $xyleme is true. The value of the variable is something like `num´ in the XML file produced by Tralics, converted to `NUM´ (all uppercase) in the new DTD. We convert it to `Num´ for the link(note: ).

1217 <xsl:template name="jg.find-theme"/>
1218   <xsl:variable name="path"
1219      select=""/>
1220   <xsl:variable name="themeurl">
1221     <xsl:choose>
1222       <xsl:when test="$xyleme='1'">
1223         <xsl:value-of select="$indexPath" />
1224         <xsl:text>?theme=</xsl:text/>
1225         <xsl:value-of select="substring(theme,1,3)" />
1226       </xsl:when>
1227       <xsl:otherwise>
1228         <xsl:value-of select="$path" />
1229         <xsl:value-of select="substring(theme,1,1)"/>
1230         <xsl:value-of select="translate(substring(theme,2,3),
1231              'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" />
1232         <xsl:text>.en.html</xsl:text>
1233       </xsl:otherwise>
1234     </xsl:choose>
1235   </xsl:variable>
1236   Theme:
1237   <a href="{$themeurl}">
1238     <xsl:call-template name="targetAttrib.alt" />
1239     <xsl:value-of select="theme" />
1240   </a>
1241 </xsl:template>

Translation of <UR>. We look at the name attribute. The code is easy, perhaps a bit longish (we do not show the complete code here). We test the value against Rocquencourt, Rennes, Sophia, Lorraine, RhoneAlpes and Futurs.

1242 <xsl:template name="UR">
1243  <xsl:variable name="orga"></xsl:variable>
1244  <div class="bigspace">
1245   <xsl:for-each select="UR">
1246     <i>
1247     <xsl:choose>
1248      <xsl:when test="@name='Rocquencourt'">
1249       <a href="{$orga}_ur-rocq.en.html">
1250         <xsl:call-template name="targetAttrib.alt" />
1251         <xsl:value-of select="@name"/>
1252       </a>
1253      </xsl:when>
1254       <!-- other cases are similar, not shown -->
1255      <xsl:otherwise>
1256        <a href="" >
1257          <xsl:call-template name="targetAttrib.alt" />
1258            INRIA</a>
1259      </xsl:otherwise>
1260     </xsl:choose>
1261    </i>
1262    <xsl:if test="position()!=last()"> - </xsl:if>
1263   </xsl:for-each>
1264  </div>
1265 </xsl:template>

This contains the HTML page with the frameset. An interesting point is that this contains the table of contents, for the case where frames are refused. Note that this is an HTML document, not an XML one (the method attribute is different); more important, all other HTML files have XHTML1.0 as doctype, this one has HTML4.01. The document contains two frames; one of them points to an HTML page whose name is dynamically constructed. The idea is the following. Normally, the variable is empty and the result of line 1282 is `uid0.html´; however, in the case of an URL like line 869 or 891, that contains a question mark, the variable is not empty, what follows the question mark is used.

1266 <xsl:template name="creer.frameset">
1267  <xsl:document href="{$Directory}/{./@id}_tf.html" method="html" encoding="iso-8859-1"
1268   doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
1269   doctype-system="">
1270   <html>
1271    <head>
1272      <title>
1273        <xsl:value-of select="$LeTypeProjet" />:
1274        <xsl:value-of select="$LeProjet" />
1275      </title>
1276      <meta name="Robots" content="noindex" />
1277      <link rel="stylesheet" href="../raweb.css" type="text/css" />
1278      <style type="text/css"> div.tdmdiv { width:100% } </style>
1279      <script type="text/javascript">
1280         contenuSRC = (
1281           ? : 'uid0.html';
1282         contenuSRC = unescape(contenuSRC);
1283         var writeFrame = '';
1284         writeFrame += '&lt;frameset COLS="235,*"&gt;';
1285         writeFrame += '&lt;frame src="<xsl:value-of select='$LeProjet' />_tdm.html"&gt;';
1286         writeFrame += '&lt;frame src="' + contenuSRC +
1287                       '" name="mainraweb06" SCROLLING="auto" &gt;';
1288         writeFrame += '&lt;\/frameset&gt;';
1289         document.write(writeFrame);
1290      </script>
1291    </head>
1292    <noscript>
1293      <h1 class="warning">Using javascript is better to read this Activity Report</h1>
1294      <xsl:call-template name="tdm" />
1295    </noscript>
1296   </html>
1297  </xsl:document>
1298 </xsl:template>

6.1.3. Titles, keywords, persons

This outputs the current section title, the <bodyTitle> of the parent, using <h2> as heading.

1299 <xsl:template name="section_title_sansTopic">
1300   <h2>Section: <xsl:value-of select="../bodyTitle" /></h2>
1301 </xsl:template>

This outputs the current title, found in <bodyTitle>, using <h2>, <h3>, <h4>, or <h5> as heading.

1302 <xsl:template match="bodyTitle" mode="titre2">
1303   <h2 class="titre2"> <xsl:apply-templates/></h2>
1304 </xsl:template>
1305 <xsl:template match="bodyTitle" mode="titre3">
1306   <h3 class="titre3"> <xsl:apply-templates/></h3>
1307 </xsl:template>
1308 <xsl:template match="bodyTitle" mode="titre4">
1309   <h4 class="titre4"><xsl:apply-templates/> </h4>
1310 </xsl:template>
1311 <xsl:template match="bodyTitle" mode="titre5">
1312   <h5 class="titre5"><xsl:apply-templates/> </h5>
1313 </xsl:template>

In the case of topics, the layout is a bit different, and titles are handled by the routines that follow. At level one, the result is a <h1>. If the title is missing, it will be replaced by the title of the section (presentation, fondements, etc.). The result is empty if the parent has no topic. Note: Tralics refuses to create a section with an empty title. In some cases, for instance if this is the first module in a sequence of more than one modules, the title will be `Introduction´. Otherwise, it will be `(Sans Titre)´ and the style sheet is assumed to do something in this case.

1314 <xsl:template match="(presentation|fondements|domaine|logiciels
1315   |resultats|contrats|international|diffusion)/subsection/bodyTitle"
1316     priority="1">
1317     <xsl:call-template name="use-id" />
1318     <xsl:if test="../subsection/@topic">
1319       <h1> <xsl:apply-templates /> </h1>
1320     </xsl:if>
1321 </xsl:template>

A title is always output by the routines shown above, hence the default action is empty.

1322 <xsl:template match="bodyTitle" />

This is how we typeset a title in the TOC. We use a <li> element and a link to the page. This fills the anchor (text and attributes). If the title is empty, the title of the parent is used instead.

1323 <xsl:template name="item_title_or_not_title">
1324   <xsl:call-template name="targetAttrib.main" />
1325   <xsl:attribute name='href'>
1326     <xsl:call-template name="formaturl">
1327       <xsl:with-param name="base" select="@id" />
1328     </xsl:call-template>
1329   </xsl:attribute>
1330   <xsl:choose>
1331     <xsl:when test="bodyTitle">
1332       <xsl:value-of select="./bodyTitle" />
1333     </xsl:when>
1334     <xsl:otherwise>
1335       <xsl:value-of select="../bodyTitle" />
1336     </xsl:otherwise>
1337   </xsl:choose>
1338 </xsl:template>

Section titles are typeset twice: in the text, and in the TOC. When we are in the TOC, ids are not added. This is not very important for the HTML, because the TOC is a separated file. For the Pdf version it is necessary; it could be necessary if we decided to add a local TOC to each page (à la minitoc, this was done, for instance in 1996).

1339 <xsl:template match="bodyTitle" mode="tocsection">
1340   <xsl:apply-templates mode="section" />
1341 </xsl:template>

This rule says that keywords are handled via keywords-list, except if we are in a toplevel subsection that has subsections, case where keywords-list2 is used instead.

1342 <xsl:template name="jg.keywords">
1343    <xsl:choose>
1344       <xsl:when test="not(./subsection)">
1345           <xsl:call-template name="keywords-list" />
1346       </xsl:when>
1347       <xsl:otherwise>
1348           <xsl:call-template name="keywords-list2" />
1349       </xsl:otherwise>
1350   </xsl:choose>
1351 </xsl:template>

We modified a bit the code that follows: there was a <p>, moved inside the template listvir(note: ). In general, when a keyword is seen, we take all <keyword> elements from the subtree, and pass them to the template.

1352 <xsl:template name="keywords-list">
1353   <xsl:if test=".//keyword">
1354      <xsl:call-template name="listvir">
1355        <xsl:with-param name='liste' select="(.//keyword)" />
1356        <xsl:with-param name='deco' select="string('keyword')" />
1357      </xsl:call-template>
1358   </xsl:if>
1359 </xsl:template>

However, in the case of a toplevel subsection (a module) with subsections, the action is different: we take only the <keyword> elements of this subsection.

1360 <xsl:template name="keywords-list2">
1361  <xsl:if test="./keyword">
1362     <xsl:call-template name="listvir">
1363       <xsl:with-param name='liste' select="(./keyword)" />
1364       <xsl:with-param name='deco' select="string('keyword')" />
1365     </xsl:call-template>
1366  </xsl:if>
1367 </xsl:template>

This is the action when we have a list of keywords to convert. The test (is there a keyword on the tree?) should probably be replaced by a better one (is the list empty?). If $xyleme is true, each keyword has a link (code omitted).

1368 <xsl:template name="listvir">
1369    <xsl:param name="liste" />
1370    <xsl:param name="deco" />
1371    <p>
1372      <xsl:if test=".//keyword"> <span clas="KW">Keywords</span> : </xsl:if>
1373      <xsl:for-each select="$liste" >
1374        <span class="{$deco}"><xsl:apply-templates /></span>
1375        <xsl:call-template name="separateur.objet" />
1376      </xsl:for-each >
1377    </p>
1378 </xsl:template>

The previous routines takes all keywords, so that the default action is empty.

1379 <xsl:template match="keyword">  </xsl:template>

In the presentation part, a <person> is handled by this code. We output the <firstname>, a space, the <lastname>, and the <moreinfo>, provided that this is not empty. Brackets are added. Since 2006, three new fields were added, only <hdr> produces something. Assume that our guy is called Jean Dupont, the result is then one of `Jean Dupont [HdR]´, `Jean Dupont [CR, HdR]´, `Jean Dupont [CR]´, `Jean Dupont´. Each bracket is preceded and followed by space, `CR´ is the content of the <moreinfo> element, and `HdR´ is produced by the templates given below (we gave a name to jg.hdr, this makes the code easier to understand). We also removed a useless test (it tested that the element is non-empty, instead of testing <moreinfo>, but we know that <moreinfo>, when present, is non-empty).

1380 <xsl:template match="person">
1381   <xsl:value-of select="./firstname" />
1382   <xsl:text> </xsl:text>
1383   <xsl:value-of select="./lastname" />
1384   <xsl:choose>
1385     <xsl:when test="moreinfo">
1386       <xsl:text> [ </xsl:text>
1387       <xsl:apply-templates select="./moreinfo/node()" />
1388       <xsl:apply-templates select="hdr" />
1389       <xsl:text> ] </xsl:text>
1390     </xsl:when>
1391     <xsl:otherwise>
1392       <xsl:call-templates select="jg.hdr" />
1393     </xsl:otherwise>
1394   </xsl:choose>
1395 </xsl:template>

Both templates shown here produce the string `habilité(e)´ which is non-sense in an English document. This will change in the final version of the RA2006, using the acronym `HdR´. The first template is called when there is no <moreinfo> in the current <pers>, it outputs the funny string with the brackets if <hdr> is present; the second one is called if there is a <moreinfo>, it just outputs the funny string, preceded by a comma.

1396 <xsl:template name="jg.hdr">
1397   <xsl:if test="hdr">
1398     <xsl:text> [ habilité(e) ] </xsl:text>
1399   </xsl:if>
1400 </xsl:template>
1401 <xsl:template match="hdr">
1402   <xsl:text>, </xsl:text>
1403   <xsl:text> habilité(e) </xsl:text>
1404 </xsl:template>

In the other sections, a <person> is similarly handled, but the code is a bit different. If $xyleme is set, an anchor is added (this is the same as for keywords, code not shown here). There are no additional fields like <hdr> to consider here.

1405 <xsl:template name="xperson">
1406   <xsl:value-of select="./firstname"/>
1407   <xsl:text> </xsl:text>
1408   <xsl:value-of select="./lastname"/>
1409   <xsl:apply-templates select="moreinfo" mode="inpers"/>
1410 </xsl:template>

If you look carefully, you can see that spaces around square brackets are different here and in the previous case.

1411 <xsl:template match="moreinfo" mode ="inpers">
1412   <xsl:if test="not(normalize-space(string(.)) ='')">
1413       <xsl:text> [</xsl:text><xsl:apply-templates/><xsl:text>]</xsl:text>
1414   </xsl:if>
1415 </xsl:template>

This takes a list as argument, it outputs an s if there are more than one element in the list.

1416 <xsl:template name="pluriel-p">
1417   <xsl:param name="liste" />
1418   <xsl:if test="count($liste)>1">s</xsl:if>
1419 </xsl:template>

In a <subsection>, the translation of <participants> is formed of every <person>, with comma as separator.

1420 <xsl:template match="subsection//participants">
1421   <p class="participants">
1422     <span class="part">Participant
1423          <xsl:call-template name="pluriel-p">
1424             <xsl:with-param name="liste" select="person" />
1425          </xsl:call-template>
1426     </span> :
1427     <xsl:for-each select="person">
1428       <xsl:call-template name="xperson" />
1429       <xsl:call-template name="separateur.objet" />
1430     </xsl:for-each>
1431   </p>
1432 </xsl:template>

6.1.4. Other elements

Let´s consider some trivial commands. We leave <i> unchanged.

1433 <xsl:template match="i">
1434   <i><xsl:apply-templates /></i>
1435 </xsl:template>

Ditto for <b>.

1436 <xsl:template match="b">
1437  <b> <xsl:apply-templates /> </b>
1438 </xsl:template>

Ditto for <tt>.

1439 <xsl:template match="tt">
1440   <tt><xsl:apply-templates /> </tt>
1441 </xsl:template>

Ditto for <small>.

1442 <xsl:template match="small">
1443   <small> <xsl:apply-templates /> </small>
1444 </xsl:template>

Ditto for <big>.

1445 <xsl:template match="big">
1446  <big> <xsl:apply-templates /> </big>
1447 </xsl:template>

Ditto for <sup>.

1448 <xsl:template match="sup">
1449   <sup> <xsl:apply-templates /> </sup>
1450 </xsl:template>

Ditto for <sub>.

1451 <xsl:template match="sub">
1452   <sub> <xsl:apply-templates /> </sub>
1453 </xsl:template>

This code is the same as above. This is used for evaluation of a title in the TOC.

1454 <xsl:template match="sup" mode="section">
1455   <sup> <xsl:apply-templates /> </sup>
1456 </xsl:template>
1457 <xsl:template match="sub" mode="section">
1458   <sub> <xsl:apply-templates /> </sub>
1459 </xsl:template>

The translation of <em> is a <i> in the case where the style attribute is `UNDERLINE´, is `HIGHLIGHT´ or is something else. We simplified a bit the code.

1460 <xsl:template match="em">
1461     <i> <xsl:apply-templates /> </i>
1462 </xsl:template>

This could be used by Xyleme.

1463 <xsl:template match="highlight">
1464    <span class="xyHighlight">
1465      <xsl:apply-templates />
1466    </span>
1467 </xsl:template>

The translation of <span> is the same element. We copy the class attribute, but not the other ones (why?).

1468 <xsl:template match="span">
1469  <span class="{@class}"> <xsl:apply-templates /> </span>
1470 </xsl:template>

We could do better.

1471 <xsl:template match="center">
1472   <xsl:apply-templates />
1473 </xsl:template>

A <term> is converted into a <tt>.

1474 <xsl:template match="term">
1475  <tt> <xsl:apply-templates /> </tt>
1476 </xsl:template>

A <simplelist> is converted into a <ul>.

1477 <xsl:template match="simplelist">
1478   <ul> <xsl:apply-templates />  </ul>
1479 </xsl:template>

A <orderedlist> is converted into a <ol>.

1480 <xsl:template match="orderedlist">
1481   <ol> <xsl:apply-templates /> </ol>
1482 </xsl:template>

A <descriptionlist> is converted into a <dl>.

1483 <xsl:template match="descriptionlist">
1484   <dl> <xsl:apply-templates /> </dl>
1485 </xsl:template>

Elements <glosslist> or <descriptionlist> should contain a <label>, a <li>, a <label>, a <li>, etc. These are converted into a <dd> or <dd> in the obvious way.

1486 <xsl:template match="glosslist/label | descriptionlist/label">
1487   <dt> <xsl:apply-templates /> </dt>
1488 </xsl:template>
1489 <xsl:template match="glosslist/li | descriptionlist/li">
1490   <dd> <xsl:apply-templates /> </dd>
1491   </xsl:template>

A <li> is converted into a <li> in cases not shown above. If preceded by a <label>, the value of the label is added.

1492 <xsl:template match="li">
1493   <li>
1494     <xsl:apply-templates select="@*" />
1495     <xsl:apply-templates mode="li" select="preceding-sibling::label[position()=1]" />
1496     <xsl:apply-templates />
1497   </li>
1498 </xsl:template>

Two rules are neeed: one that says that <label> should be ignored, and one that say that it should be translated (from inside the <li>, where the mode is correct).

1499 <xsl:template match="label" />
1501 <xsl:template match="label" mode="li">
1502   <xsl:apply-templates />
1503 </xsl:template>

A <glosslist> is converted into a <dl>. It has a title, is put in a <div>, preceded and followed by a horizontal rule, a <hr> element.

1504 <xsl:template match="glosslist">
1505   <hr />
1506   <div id="glossaire" style="margin-left: 2em;margin-right: 2em;">
1507     <dl title="Glossary"> <xsl:apply-templates /> </dl>
1508    </div>
1509   <hr />
1510 </xsl:template>

The translation of <moreinfo> is a <blockquote>, unless it is in a <pers>, case where the code on lines 1387 or 1409 applies.

1511 <xsl:template match="moreinfo">
1512   <blockquote>  <xsl:apply-templates /> </blockquote>
1513 </xsl:template>

Action is empty here. Normally, there should be no <moreinfo> in <raweb>, it should be in <identification>.

1514 <xsl:template match="/raweb/moreinfo" priority="1"/>

The translation of <simplemath> is <i>. Such an element is generated by Tralics in the case of a trivial formula like $x$.

1515 <xsl:template match="simplemath">
1516   <i> <xsl:apply-templates /> </i>
1517 </xsl:template>

Math formulas are copied verbatim, with their context. We assume that either the browser understands MathML or that a postprocessor converts the math.

1518 <xsl:template match="m:math">
1519   <xsl:copy>
1520       <xsl:apply-templates mode="math" />
1521   </xsl:copy>
1522 </xsl:template>
1524 <xsl:template mode="math" match="*|@*|text()">
1525  <xsl:copy>
1526     <xsl:apply-templates mode="math" select="*|@*|text()" />
1527  </xsl:copy>
1528 </xsl:template>

This is for the case where the math appears in a title in the TOC.

1529 <xsl:template match="m:math" mode="section">
1530   <m:math>
1531       <xsl:copy-of select="@*" />
1532       <xsl:apply-templates mode="math" />
1533    </m:math>
1534 </xsl:template>

Translation of <formula>. It depends on the type attribute. If this is not `display´, the result is a simple <span>, with attribute class = `math´. If the type is `display´, the result is a <div>, with attribute class = `mathdisplay´, and align = `center´. Moreover, if there is an id, an equation number is added. For this reason a <table> is created, with a single <tr> and two <td>, first the formula, centered, then its number, right aligned.

1535 <xsl:template match="formula">
1536  <xsl:choose>
1537   <xsl:when test="@type = 'display' and @id">
1538    <div align="center" class="mathdisplay">
1539      <xsl:call-template name="use-id" />
1540      <table width='100%'>
1541       <tr valign='middle'>
1542        <td align='center'> <xsl:apply-templates /> </td>
1543        <td class="eqno" width="10" align="right">(<xsl:number
1544                                   level="any" count="formula[@id]" />)</td>
1545       </tr>
1546      </table>
1547    </div>
1548   </xsl:when>
1549   <xsl:when test="@type = 'display'">
1550     <div align="center" class="mathdisplay"> <xsl:apply-templates /> </div>
1551   </xsl:when>
1552   <xsl:otherwise>
1553    <span class="math"> <xsl:apply-templates /> </span>
1554   </xsl:otherwise>
1555  </xsl:choose>
1556 </xsl:template>

The translation of <footnote>Text</footnote> is `(Text)´, this is much more legible than a link to the text.

1557 <xsl:template match='footnote'>
1558   <xsl:text>(</xsl:text><xsl:apply-templates /><xsl:text>)</xsl:text>
1559 </xsl:template>

Because of the code above, a <p> in a footnote cannot be transformed into a paragraph.

1560 <xsl:template match="footnote/p">
1561   <xsl:apply-templates />
1562 </xsl:template>

The translation of <p> is a <blockquote> if the rend attribute is `quoted´. Otherwise, it is a <p>. If rend is `center´ or `centered´, we add align = `center´. If noindent is given(note: ), we add class = `notaparagraph´.

1563 <xsl:template match="p">
1564   <xsl:choose>
1565     <xsl:when test="@rend='quoted'">
1566         <blockquote> <xsl:apply-templates /> </blockquote>
1567     </xsl:when>
1568     <xsl:otherwise>
1569       <p>
1570         <xsl:choose>
1571           <xsl:when test="@rend='centered' or @rend='center'">
1572              <xsl:attribute name="align">center</xsl:attribute>
1573           </xsl:when>
1574           <xsl:when test="@noindent">
1575             <xsl:attribute name="class">notaparagraph</xsl:attribute>
1576           </xsl:when>
1577         </xsl:choose>
1578         <xsl:apply-templates />
1579       </p>
1580     </xsl:otherwise>
1581   </xsl:choose>
1582 </xsl:template>

This is a bit strange. Currently(note: ) Tralics does not produce <anchor> elements. Note: the <a> element as shown here is empty, in reality, it contains a space. Why?

1583 <xsl:template name="use-id">
1584   <xsl:if test="@id"> <a name="{@id}" />  </xsl:if>
1585   <xsl:if test="anchor/@id"><a name="{anchor/@id}" /> </xsl:if>
1586 </xsl:template>

Translation of <table>. We call some template. The result will be in a <div>.

1587 <xsl:template match="table">
1588  <div class="notinline" align='center' style="margin-top:20px">
1589     <xsl:call-template name="use-id" />
1590     <xsl:call-template name='generate-table' />
1591  </div>
1592 </xsl:template>

If the table is inline, there is no reference to it (we can omit the id), and we do not produce a <div>.

1593 <xsl:template match="table[@rend='inline']">
1594   <xsl:call-template name='generate-table' />
1595 </xsl:template>

This is called when the table comes from an object. Note that the `mode´ is useless in the `xsl:call-template´.

1596 <xsl:template match="table" mode="object">
1597   <xsl:call-template name="use-id" />
1598   <xsl:call-template name='generate-table' mode="object" />
1599 </xsl:template>

Translation of <table>. The result is a table, that contains the translation of the <caption>, followed by some <tr> elements. Each such elements is the translation of a <tr>, it is formed of the translation of all cells, the <td> and <th> sub-elements. The style attribute of each cell is copied, as well as the style of the row(note: ), in the case where the cell is empty, a height of three pixels is added. If an attribute rows or cols is present, it is transformed into rowspan or colspan. If a child of a cell is a <ressource>, the align attribute is set to center(note: ).

1600 <xsl:template name="generate-table">
1601  <table>
1602   <xsl:apply-templates select="caption" />
1603   <xsl:for-each select="tr">
1604    <tr>
1605     <xsl:for-each select="td|th">
1606      <xsl:element name="{name()}">
1607       <xsl:attribute name="style">
1608         <xsl:if test="normalize-space(.) = ''">height:3px;</xsl:if>
1609         <xsl:value-of select="@style" />
1610         <xsl:value-of select="../@style" />
1611       </xsl:attribute>
1612       <xsl:if test="@cols">
1613         <xsl:attribute name="colspan"><xsl:value-of select="@cols" /></xsl:attribute>
1614       </xsl:if>
1615       <xsl:if test="@rows">
1616         <xsl:attribute name="rowspan"><xsl:value-of select="@rows" /></xsl:attribute>
1617       </xsl:if>
1618       <xsl:if test="ressource">
1619          <xsl:attribute name="align">center</xsl:attribute>
1620       </xsl:if>
1621       <xsl:apply-templates />
1622      </xsl:element>
1623     </xsl:for-each>
1624    </tr>
1625   </xsl:for-each>
1626  </table>
1627 </xsl:template>

A style attribute is always copied.

1628 <xsl:template match="@style">
1629   <xsl:attribute name="style"><xsl:value-of select="." /></xsl:attribute>
1630 </xsl:template>

A align attribute is converted to a style attribute.(note: )

1631 <xsl:template match="@align">
1632  <xsl:attribute name="style">text-align:<xsl-value-of select="." /></xsl:attribute>
1633 </xsl:template>

The translation of a <caption> in a table is a <caption> element. It contains the table number (it should be the same as the one given by calculateTableNumber).

1634 <xsl:template match="table/caption" >
1635   <caption align="bottom">
1636     <strong>Table
1637       <xsl:number count="table[not(ancestor::object)]" level="any" />
1638         <xsl:text>. </xsl:text>
1639     </strong>
1640     <xsl:apply-templates />
1641   </caption>
1642 </xsl:template>

The translation of a <caption> in a table in a figure. The result is a simple <caption>. There should be no reference to it.

1643 <xsl:template match="object//table/caption" priority="1">
1644    <caption> <xsl:apply-templates /> </caption>
1645 </xsl:template>

Translation of <img>. We copy the attributes width, height, align, border, alt, and src. Note: the <img> element is not defined by the DTD. Thus, the author of the document should not create them; on the other hand, there is a post-processor that replaces some math formulas by images that match this usage. In the case where $xyleme is set and there is an attribute xylemeAttach, the src attribute is computed differently.

1646 <xsl:template match="img">
1647  <img>
1648    <xsl:if test="@width">
1649      <xsl:attribute name="width"><xsl:value-of select="@width" /></xsl:attribute>
1650    </xsl:if>
1651    <xsl:if test="@height">
1652      <xsl:attribute name="height"><xsl:value-of select="@height" /></xsl:attribute>
1653    </xsl:if>
1654    <xsl:attribute name="align"><xsl:value-of select="@align" /></xsl:attribute>
1655    <xsl:attribute name="border"><xsl:value-of select="@border" /></xsl:attribute>
1656    <xsl:attribute name="alt"><xsl:value-of select="@alt" /></xsl:attribute>
1657    <xsl:attribute name="src">
1658      <xsl:choose>
1659        <xsl:when test="($xyleme='1') and @xylemeAttach">
1660          <xsl:value-of select="$imgpath" />
1661          <xsl:apply-templates select="@xylemeAttach" />
1662        </xsl:when>
1663        <xsl:otherwise>
1664          <xsl:value-of select="@src" />
1665        </xsl:otherwise>
1666      </xsl:choose>
1667    </xsl:attribute>
1668   </img>
1669 </xsl:template>

Given a string $str, of the form `´, this procedure returns what follows the last dot, namely `gee´. It is a recursive procedure.

1670 <xsl:template name="get-extention" >
1671   <xsl:param name="str" />
1672   <xsl:choose>
1673     <xsl:when test="substring-after($str,'.')=''">
1674      <xsl:value-of select="$str" />
1675     </xsl:when>
1676     <xsl:otherwise>
1677       <xsl:call-template name="get-extention">
1678         <xsl:with-param name="str" select="substring-after($str,'.')" /> <!--$-->
1679       </xsl:call-template>
1680     </xsl:otherwise>
1681   </xsl:choose>
1682 </xsl:template>

Consider an image that has an attribute src with value `toto.png´ or aux with value `titi.gif´, and attribute xylemeAttach with value `foo´, this gives `foo.png´ or `foo.gif´ (we assume that only one extension will be found).

1683 <xsl:template match="@xylemeAttach">
1684    <xsl:value-of select="." />
1685    <xsl:text>.</xsl:text>
1686    <xsl:call-template name="get-extention">
1687       <xsl:with-param name="str" select="../@src|../@aux" />
1688    </xsl:call-template>
1689  </xsl:template>

Translation of <ressource>. The attribute media is `WEB´ by default. No rule applies otherwise.

1690 <xsl:template match="ressource[@media='WEB']">
1691   <xsl:call-template name='generate-graphics' />
1692   <xsl:apply-templates select="caption" />
1693 </xsl:template>

There is something strange here. If you specify both width and height, only the last attribute will be put in style. Perhaps, something like the code on lines 1607-1611 should be used instead. In the current version, a complicated procedure is used to get the name of the image.

1694 <xsl:template name="generate-graphics">
1695   <img>
1696     <xsl:if test="@width">
1697      <xsl:attribute name="style">width:<xsl:value-of select="@width" /></xsl:attribute>
1698     </xsl:if>
1699     <xsl:if test="@height">
1700      <xsl:attribute name="style">height:<xsl:value-of select="@height" /></xsl:attribute>
1701     </xsl:if>
1702     <xsl:attribute name='alt'><xsl:value-of select="@xlink:href" /></xsl:attribute>
1703     <xsl:attribute name='src'>
1704       <xsl:value-of select="$imgpath" />
1705       <xsl:choose>
1706         <xsl:when test="($xyleme='1') and @xylemeAttach">
1707           <xsl:apply-templates select="@xylemeAttach" />
1708         </xsl:when>
1709         <xsl:when test="@png">
1710           <xsl:value-of select="$LeProjet"/>/<xsl:value-of select="@png" />
1711         </xsl:when>
1712         <xsl:when test="@gif">
1713           <xsl:value-of select="$LeProjet"/>/<xsl:value-of select="@gif" />
1714         </xsl:when>
1715         <xsl:when test="@jpg">
1716           <xsl:value-of select="$LeProjet"/>/<xsl:value-of select="@jpeg" />
1717         </xsl:when>
1718         <xsl:when test="@aux">
1719           <xsl:value-of select="$LeProjet"/>/<xsl:value-of select="@aux" />
1720         </xsl:when>
1721         <xsl:otherwise>
1722           <xsl:value-of select="$LeProjet"/><xsl:value-of select="@xlink:href"/>
1723         </xsl:otherwise>
1724       </xsl:choose>
1725     </xsl:attribute>
1726   </img>
1727 </xsl:template>

Translation of <object>. The result is a <div>, that contains a <table>. Each table in the object is converted into a single <td> in a <tr>.

1728 <xsl:template match="object">
1729  <div align='center' style='margin-top:10px'>
1730     <a name="{./@id}"></a>
1731     <table title="{@title}" class="objectContainer">
1732        <xsl:call-template name="objectCaption" />
1733        <xsl:for-each select="table">
1734           <tr align="center">
1735             <td> <xsl:apply-templates select="." mode="object" /> </td>
1736           </tr>
1737        </xsl:for-each>
1738     </table>
1739   </div>
1740 </xsl:template>

Translation of a <caption> of a <object>. It is like the caption of a table, but with name `Figure´ instead of `Table´.

1741 <xsl:template name="objectCaption">
1742   <caption align='bottom'>
1743       <strong>Figure
1744         <xsl:call-template name="calculateObjectNumber" />
1745         <xsl:text>. </xsl:text></strong>
1746       <xsl:apply-templates select="caption" />
1747   </caption>
1748 </xsl:template>

If the caption is in a resource in a cell, we output a <br>, and the value of the caption.

1749 <xsl:template match="td/ressource/caption" priority="1">
1750   <br />
1751   <xsl:apply-templates />
1752 </xsl:template>

If the caption is in a ressource, we output the value of the caption.

1754 <xsl:template match="ressource/caption">
1755   <xsl:apply-templates />
1756 </xsl:template>

If the caption matches none of the rules above, we output the value of the caption.

1758 <xsl:template match="caption">
1759   <xsl:apply-templates />
1760 </xsl:template>

These two elements exist so that we can transform them into TeX or LaTeX in the Pdf result. In the HTML, it is better to use letters only.

1761 <xsl:template match="LaTeX">LaTeX</xsl:template>
1762 <xsl:template match="TeX">TeX</xsl:template>

This is a helper function. It adds a comma if the element is not the last.

1763 <xsl:template name="separateurED.objet">
1764   <xsl:if test="position() &lt; last()">, </xsl:if>
1765 </xsl:template>

This is a helper function. It adds a comma if the element is not the last, a dot otherwise.

1766 <xsl:template name="separateur.objet">
1767   <xsl:choose>
1768     <xsl:when test="position() &lt; last()">, </xsl:when>
1769     <xsl:otherwise>.</xsl:otherwise>
1770   </xsl:choose>
1771 </xsl:template>

6.1.5. References

The translation of <ref> is an <a>. The non trivial point is to compute the value (the reference is much easier). If the link does not start with a #, it is an external link, this will be handled later. Otherwise some variables are used. First, $curid is the target id (the link without the #), and $curelement is the target. In Tralics, this can be a section, a math formula, an image, a table, a bibliographic entry, a footnote, an item in a list(note: ). In the Raweb, other elements might be referenced. We consider three variables: $cursubsection, $curbiblio and $curidentification, that contains ancestors of the target. These variables hold nodesets; their intersection is empty.

1772 <xsl:template match="ref">
1773   <xsl:choose>
1774     <xsl:when test="starts-with(@xlink:href, '#')">
1775       <xsl:variable name="curid"
1776           select="substring-after(@xlink:href, '#')" />
1777         <xsl:variable name="curelement"
1778           select="/raweb//*[@id=$curid]" />
1779         <xsl:variable name="cursubsection"
1780           select="$curelement/ancestor-or-self::subsection" />
1781         <xsl:variable name="curbiblio"
1782           select="$curelement/ancestor-or-self::biblio" />
1783         <xsl:variable name="curidentification"
1784           select="$curelement/ancestor-or-self::identification" />

Case one. $curidentification is not empty. This assumes that only one target exists in the page. A safer solution would be to replace $curid by the id of the <team> element. Case two, the target is in a subsection. We consider the first subsection (in document order), its id gives the name of the HTML page, it suffices to add the local part. The content of the link is computed elsewhere. In the third case, the target is in the bibliography. Otherwise, let´s hope that the target is a section, we use the first subsection of it.

1785     <xsl:choose>
1786      <xsl:when test="$curidentification">
1787        <a>
1788          <xsl:attribute name='href'>
1789            <xsl:call-template name="formaturl">
1790              <xsl:with-param name="base" select="$curid"/>
1791            </xsl:call-template>
1792          </xsl:attribute>
1793        </a>
1794      </xsl:when>
1795      <xsl:when test="$curbiblio">
1796        <xsl:apply-templates select="." mode="ref2biblio" >
1797          <xsl:with-param name="curelement" select="$curelement" />
1798        </xsl:apply-templates>
1799      </xsl:when>
1800      <xsl:when test="$cursubsection">
1801        <a href="./{$cursubsection[1]/@id}.html{@xlink:href}">
1802             <xsl:apply-templates mode="xref" select="$curelement" />
1803        </a>
1804      </xsl:when>
1805      <xsl:when test="$cursubsection"> <!-- vers la meme section -->
1806        <a>
1807          <xsl:attribute name='href'>
1808            <xsl:call-template name="formaturl">
1809              <xsl:with-param name="base" select="$cursubsection[1]/@id" />
1810            </xsl:call-template>
1811            <xsl:value-of select="@xlink:href" />
1812          </xsl:attribute>
1813          <xsl:attribute name="title">
1814            <xsl:value-of select="$cursubsection/bodyTitle" />
1815          </xsl:attribute>
1816          <xsl:apply-templates mode="xref" select="$curelement" />
1817        </a>
1818      </xsl:when>
1819      <xsl:otherwise>
1820       <a>
1821         <xsl:attribute name="title">
1822           <xsl:value-of select="$curelement/subsection[1]/subsection" />
1823         </xsl:attribute>
1824         <xsl:attribute name="href">
1825           <xsl:call-template name="formaturl">
1826              <xsl:with-param name="base" select="$curelement/subsection[1]/@id" />
1827           </xsl:call-template>
1828         </xsl:attribute>
1829         <xsl:apply-templates mode="xref" select="$curelement" />
1830       </a>
1831      </xsl:otherwise>
1832     </xsl:choose>
1833    </xsl:when>

In the case of an external reference, things are easier. The value of the <ref> element is assumed non-empty.(note: )

1834   <xsl:otherwise>
1835    <a>
1836      <xsl:attribute name="href"><xsl:value-of select="@xlink:href" /></xsl:attribute>
1837      <xsl:call-template name="targetAttrib.alt" />
1838      <xsl:apply-templates />
1839    </a>
1840   </xsl:otherwise>
1841  </xsl:choose>
1842 </xsl:template>

For every element, like <formula>, that can be the target of a <ref>, we must compute its number. This is the value seen on the screen. In the case of a formula, this is easy, we just count all formulas with a number (i.e., with an id). Note: this behavior is different from what happens in the Pdf case. For this reason it would be safer to replace the code on line 1637 by a call to this template.(note: )

1843 <xsl:template match="formula" mode="xref">
1844   <xsl:number level="any" count="formula[@id]" />
1845 </xsl:template>

In the case of a <table>, computation is non trivial. We use an intermediate command.

1846 <xsl:template match='table' mode="xref">
1847   <xsl:call-template name="calculateTableNumber" />
1848 </xsl:template>

This is how we count them: if the <table> is in an <object> it is not counted.

1849 <xsl:template name="calculateTableNumber">
1850    <xsl:number count="table[not(ancestor::object)]" level="any" />
1851 </xsl:template>

The same idea is used for <object> and <ressource>: we use a command.

1852 <xsl:template match="ressource" mode="xref">
1853   <xsl:call-template name="calculateRessourceNumber" />
1854 </xsl:template>
1855 <xsl:template match="object" mode="xref">
1856     <xsl:call-template name="calculateObjectNumber" />
1857 </xsl:template>

In order to understand this, remember that an <object> can contain a <table> that can contain some <ressource>. If an object contains more than one image, there is currently no way to refer to a specific image (Tralics allows you to reference the object, not the images). Hence, the number of a ressource is the number of its parent object.

1858 <xsl:template name="calculateObjectNumber">
1859   <xsl:number count="object" level="any" />
1860 </xsl:template>
1862 <xsl:template name="calculateRessourceNumber">
1863   <xsl:apply-templates select="ancestor::object[1]" mode="xref" />
1864 </xsl:template>

This returns the number of the section in which the element is. Note that `fondements´ are numbered 3, even if `presentation´ is missing(note: ). If you don´t like this, then you should fill all sections(note: ).

1865 <xsl:template name="sec.num">
1866     <xsl:choose>
1867       <xsl:when test="ancestor-or-self::*[self::identification]"> 0</xsl:when>
1868       <xsl:when test="ancestor-or-self::*[self::presentation]">   1</xsl:when>
1869       <xsl:when test="ancestor-or-self::*[self::fondements]"> 2</xsl:when>
1870       <xsl:when test="ancestor-or-self::*[self::domaine]">  3</xsl:when>
1871       <xsl:when test="ancestor-or-self::*[self::logiciels]">  4</xsl:when>
1872       <xsl:when test="ancestor-or-self::*[self::resultats]">  5</xsl:when>
1873       <xsl:when test="ancestor-or-self::*[self::contrats]">   6</xsl:when>
1874       <xsl:when test="ancestor-or-self::*[self::international]"> 7</xsl:when>
1875       <xsl:when test="ancestor-or-self::*[self::diffusion]">  8</xsl:when>
1876       <xsl:when test="ancestor-or-self::*[self::biblio]">  9</xsl:when>
1877       <xsl:otherwise>*-</xsl:otherwise>
1878     </xsl:choose>
1879  </xsl:template>

The number associated to each section is given by the procedure above.

1880 <xsl:template match="identification|presentation|fondements|domaine|
1881       logiciels|resultats|contrats|international|diffusion|biblio"
1882     mode="xref">
1883     <xsl:call-template name="sec.num" />
1884 </xsl:template>

This computes the number of a subsection.

1885 <xsl:template match="subsection" mode="xref">
1886   <xsl:call-template name="calculateNumbersubsection" />
1887 </xsl:template>

We count the number of subsections, this is preceded by the section number. We removed here the variable $numbersuffix, replacing it by a simple <xsl:text> element.

1888 <xsl:template name="calculateNumbersubsection">
1889    <xsl:call-template name="sec.num" />
1890    <xsl:text>.</xsl:text>
1891    <xsl:number level="multiple" grouping-separator="."
1892      from="raweb" format="1.1" count="subsection" />
1893 </xsl:template>

In the case of a title or an anchor, we call a template (originally, there were two templates).

1894 <xsl:template match="bodyTitle|anchor" mode="xref">
1895     <xsl:call-template name="calculateNumber" />
1896 </xsl:template>

The number we compute in the generic case is the number of its subsection.

1897 <xsl:template name="calculateNumber">
1898    <xsl:call-template name="sec.num" />
1899    <xsl:text>.</xsl:text>
1900    <xsl:number level="multiple" from="raweb" format="1.1" count="subsection" />
1901 </xsl:template>

That´s the end of the file.

1902 </xsl:stylesheet>
1903 <xsl:template match="@id">
1904   <xsl:attribute name="id"><xsl:value-of select="." /></xsl:attribute>
1905 </xsl:template>

6.2. Dealing with topics

The following three templates do nothing in static mode, but add a class attribute to the current element. For simplicity, the calls to these templates are often omitted.

1906 <xsl:template name="isSamePage" />
1907 <xsl:template name="isPageTeam" />
1908 <xsl:template name="isPageBiblio"/>

There are two views: with and without topics. The difference resides in how pages are linked together, hence has an influence on the table of contents. We show here how to compute the next page.

1909 <xsl:template name="suivant">
1910   <xsl:choose>
1911     <xsl:when test="$isTopic='1'">
1912       <xsl:call-template name="suivant_avec_topic" />
1913     </xsl:when>
1914     <xsl:otherwise>
1915       <xsl:call-template name="suivant_sans_topic" />
1916     </xsl:otherwise>
1917   </xsl:choose>
1918 </xsl:template>

There are additional templates that follow the same scheme. The template precedent returns the previous page, tdm and table.matieres create the table of contents, toclink produces a link to the TOC.

1919 <xsl:template name="precedent">
1920   choose one of "precedent_avec_topic""precedent_sans_topic"
1921 </xsl:template>
1923 <xsl:template name="noframe_p">
1924   choose one of "noframe_p_Topic" "noframe_p_sansTopic"
1925 </xsl:template>
1927 <xsl:template name="tdm">
1928   choose one of "tdm_Topic" "tdm_sansTopic"
1929 </xsl:template>
1931 <xsl:template name="table.matieres">
1932   choose one of "table.matieres_Topic" "table.matieres_sansTopic"
1933 </xsl:template>
1935 <xsl:template name="toclink">
1936   choose one of "toclink_Topic" "toclink_sansTopic"
1937 </xsl:template>

In the static version, these produce nothing (and more than often we shall omit the call).

1938 <xsl:template name="noframe_p_sansTopic" />
1939 <xsl:template name="noframe_p_Topic/">

Now comes the delicate part: what is the previous or next page? Finding the previous module is rather easy: if there is a previous module in the section, we chose it; if there is a previous section we chose the last module of it; otherwise it is the front page.

1940 <xsl:template name="precedent_sans_topic">
1941   <xsl:choose>
1942     <xsl:when test="preceding-sibling::subsection">
1943       <xsl:value-of select="preceding-sibling::subsection[1]/@id" />
1944     </xsl:when>
1945     <xsl:when test="../preceding-sibling::*[1]/subsection">
1946       <xsl:value-of select="../preceding-sibling::*[1]/subsection[position()=last()]/@id"/>
1947     </xsl:when>
1948     <xsl:otherwise>
1949        <xsl:value-of select="/raweb/identification/team/@id" />
1950     </xsl:otherwise>
1951   </xsl:choose>
1952 </xsl:template>

Finding the next module is easy too: if there is a next module in the section, we chose it; if there is a next section we chose the first module of it; otherwise it is the bibliography.

1953 <xsl:template name="suivant_sans_topic">
1954   <xsl:choose>
1955     <xsl:when test="following-sibling::subsection">
1956       <xsl:value-of select="following-sibling::subsection[1]/@id" />
1957     </xsl:when>
1958     <xsl:when test="../following-sibling::*[1]/subsection">
1959       <xsl:value-of select="../following-sibling::*[1]/subsection[1]/@id" />
1960     </xsl:when>
1961     <xsl:otherwise>
1962       <xsl:text>bibliography</xsl:text>
1963     </xsl:otherwise>
1964   </xsl:choose>
1965 </xsl:template>

The situation is a bit more complicated in the case of topics. Assume that S3M4 is module 4 in section 3 and T2S3M4 is module 4 in section 3 with topic 2. Topics are allowed only in sections 3 to 6. The ordering is the following: S1M1, S1M2, S2M1, S2M2, T1S3M1, T1S3M2, T1S4M1, T1S4M2, T1S5M1, T1S5M2, T1S6M1, T1S6M2, T2S3M1, T2S3M2, T2S4M1, T2S4M2, T2S5M1, T2S5M2, T2S6M1, T2S6M2, S7M1, S7M2, S8M1, S8M2, S9M1, S9M2, S10M1, S10M2. We assume that a module has a topic attribute if and only if it is in a section with topics. This attribute has a symbolic value, say A, B, C. The start of the document contains a list of <topic> elements, say <tA>, <tB>, <tB>, with id A, B and C, that define the order (A comes before B if <tA> is before <tB>).

This finds the previous module. There are two cases to consider: it depends on whether we are in the topic part, or non-topic part. We use two variables: $var is the current topic id and $precedentTopic is the previous topic (or is empty if there is no previous topic).

1966 <xsl:template name="precedent_avec_topic">
1967   <xsl:variable name="var" select="./@topic" />
1968   <xsl:variable name="precedentTopic"
1969        select="/raweb/topic[@id=$var]/preceding-sibling::topic[1]" />
1970   <xsl:choose>

First assume that the module has a topic. The easy case is when there is a preceding sibling with the same topic. We chose the first one. Otherwise, we consider all modules that have as topic the previous topic; we select the last one; if this fails, we select the last module of the presentation section.

1971     <xsl:when test="./@topic">
1972       <xsl:choose>
1973         <xsl:when test="preceding::subsection[@topic=$var]">
1974           <xsl:value-of select="preceding::subsection[@topic=$var][1]/@id" />
1975         </xsl:when>
1976         <xsl:when test="/raweb/descendant::subsection[@topic=($precedentTopic/@id)]">
1977           <xsl:variable name="precedingTopicId" select="$precedentTopic/@id" />
1978           <xsl:variable name="lastSubsection"
1979              select="/raweb/descendant::subsection[@topic=($precedentTopic/@id)][last()]" />
1980           <xsl:value-of select="$lastSubsection/@id" />
1981         </xsl:when>
1982         <xsl:otherwise>
1983            <xsl:value-of select="/raweb/presentation/subsection[last()]/@id" />
1984         </xsl:otherwise>
1985       </xsl:choose>
1986     </xsl:when>

We consider now the case where the module has no topic. In the case where there is a preceding sibling in the same section without topic, we chose the first one. In the case where the section is the presentation, our module is located before the modules with topics, thus the preceding page is that with the composition. If there is a preceding module without topic, we use it. Otherwise, if there are topics, and if there is a module with a topic, we chose the last module of the last topic. Otherwise, we chose the page with the team.

1987     <xsl:otherwise>
1988       <xsl:choose>
1989         <xsl:when test="parent::presentation and position()=1">
1990           <xsl:value-of select="/raweb/identification/team/@id" />
1991         </xsl:when>
1992         <xsl:when test="preceding-sibling::subsection[not(./@topic)]">
1993           <xsl:value-of select="preceding-sibling::subsection[not(./@topic)][1]/@id" />
1994         </xsl:when>
1995         <xsl:when test="../preceding-sibling::*[1]/subsection[not(./@topic)]">
1996           <xsl:value-of select="../preceding-sibling::*[1]/
1997                       subsection[not(./@topic)][last()]/@id" />
1998         </xsl:when>
1999         <xsl:when test="/raweb/topic and /raweb/descendant::subsection[@topic]">
2000           <xsl:variable name="lastTopic" select="//topic[last()]/@id" />
2001           <xsl:variable name="lastSubsection"
2002              select="/raweb/descendant::subsection[@topic=$lastTopic][last()]" />
2003           <xsl:value-of select="$lastSubsection/@id" />
2004         </xsl:when>
2005         <xsl:otherwise>
2006           <xsl:value-of select="/raweb/identification/team/@id" />
2007         </xsl:otherwise>
2008       </xsl:choose>
2009     </xsl:otherwise>
2010   </xsl:choose>
2011 </xsl:template>

This finds the next module. The algorithm is the same as above (to be precise: if X precedes Y, then Y follows X).

2012 <xsl:template name="suivant">
2013   <xsl:variable name="var" select="./@topic" />
2014   <xsl:variable name="followingTopic"
2015      select="/raweb/topic[@id=$var]/following-sibling::topic[1]" />
2016   <xsl:choose>

There are two cases to consider. First assume that the module has a topic. The easy case is when there is a following sibling with a topic. We chose the first one. The next case is when there is a module with the following topic. We chose the first one. Then we consider the case where the current topic is the last one, and there is a module in one of the main sections (not presentation) that has no topic; the first one is selected. Otherwise, the next page is the bibliography.

2017     <xsl:when test="./@topic">
2018       <xsl:choose>
2019         <xsl:when test="following::subsection[@topic=$var]">
2020           <xsl:value-of select="following::subsection[@topic=$var][1]/@id" />
2021         </xsl:when>
2022         <xsl:when test="/raweb/descendant::subsection[@topic=$followingTopic/@id]">
2023           <xsl:value-of select="/raweb/descendant::subsection
2024                                 [@topic=$followingTopic/@id][1]/@id" />
2025         </xsl:when>
2026         <xsl:when test="not($followingTopic) and
2027               /raweb/*[name()!='presentation']/subsection[not(@topic)]">
2028           <xsl:value-of select="/raweb/*[name()!='presentation']/
2029                                 subsection[not(@topic)][1]/@id" />
2030         </xsl:when>
2031         <xsl:otherwise>
2032           <xsl:text>bibliography</xsl:text>
2033         </xsl:otherwise>
2034       </xsl:choose>
2035     </xsl:when>

We consider here the case where the module has no topic. The easy case is when the section contains a following module without topic. Then comes the case where we are in the presentation section, it is the last module, and there is a module with a topic: in this case we chose the first module with the first topic. Otherwise we consider the case where there is a following module without topic, we chose the first one. Otherwise, we select the bibliography.

2036     <xsl:otherwise>
2037       <xsl:choose>
2038         <xsl:when test="following-sibling::subsection[not(@topic)]">
2039           <xsl:value-of select="following-sibling::subsection[not(@topic)][1]/@id" />
2040         </xsl:when>
2041         <xsl:when test="parent::presentation and (position()=last())
2042                and /raweb/descendant::subsection[@topic]">
2043           <xsl:variable name="firstTopicId" select="/raweb/topic[1]/@id" />
2044           <xsl:value-of select="/raweb/descendant::subsection
2045                                            [@topic=$firstTopicId][1]/@id" />
2046         </xsl:when>
2047         <xsl:when test="../following-sibling::*[1]/subsection[not(@topic)]">
2049           <xsl:value-of select="../following-sibling::*[1]/subsection
2050                                          [not(@topic)][1]/@id" />
2051         </xsl:when>
2052         <xsl:otherwise>
2053           <xsl:text>bibliography</xsl:text>
2054         </xsl:otherwise>
2055       </xsl:choose>
2056     </xsl:otherwise>
2057   </xsl:choose>
2058 </xsl:template>

This is strange. We removed all tests concerning the $type parameter (which is never provided). If the $base is `foo´, this constructs ./foo.html.

2059 <xsl:template name="formaturl">
2060   <xsl:param name="base" />
2061   <xsl:param name="type" />
2062   ./<xsl:value-of select="$base" />.html
2063 </xsl:template>

In the case where topics are present, there are two possible views: with topics or without; you can switch from one view to the other by clicking somewhere in the frame with the TOC.

This piece of code is used in the case where the document has topics, and we generate the TOC without topics; you will see a line containing `View by sections´ and `View by topics´. These pieces of text have different colors, the second one is associated to an anchor (that has a style attribute that says: no decoration, the change of color should be enough).

Note that the target is `_parent´, so that the loading the aoste_tf.html file (or the same with `Topics´) will remove this page and the sibling frame, replacing them by two pages (TOC and main page).

2064 <xsl:template name="acces.topic">
2065     <div id="bouton">
2066       <div id="clair">View by sections</div>
2067       <div id="fonce">
2068         <a style="text-decoration:none" target="_parent">
2069           <xsl:call-template name="lienVersTopics" />
2070           <div id="bouton_tdm_click">
2071             <font color="#FFFFFF">View by topics</font>
2072           </div>
2073         </a>
2074       </div>
2075     </div>
2076     <br />
2077 </xsl:template>

This constructs the name ../aoste_Topics/aoste_tf.html of the file with topics.

2078 <xsl:template name="lienVersTopics">
2079   <xsl:attribute name="href" >
2080     <xsl:value-of select="concat('../',$LeProjet,'_Topics/',$LeProjet,'_tf.html')"/>
2081   </xsl:attribute>
2082 </xsl:template>

This piece of code is used in the case where the document has topics, and we generate the TOC with topics; you will see the same text as above; but colors are different and the link points to ../aoste/aoste_tf.html.

2083 <xsl:template name="acces.topic_Topic">
2084   <br />
2085   <div id="bouton">
2086     <div id="fonce_T">
2087       <a href="../{$LeProjet}/{$LeProjet}_tf.html"
2088        style="text-decoration:none" target="_parent">
2089          <div id="bouton_tdm_click">
2090            <font color="#FFFFFF">View by sections</font>
2091          </div>
2092        </a>
2093      </div>
2094      <div id="clair_T">View by topics</div>
2095   </div>
2096 </xsl:template>

Our next object is the table of contents. There are four cases to consider. The main page contains the TOC defined by table.matieres, and there is a frame containting the TOC (defined by tdm), they exist in two versions, with or without topics. Let´s start with the frame.

This creates the full table of contents, that is on the front page. We have three parts: composition, main TOC, bibliography.

2097 <xsl:template name="table.matieres_sansTopic">
2098   <ul class="tdm_frame">
2099     <xsl:call-template name="jg.tdm.members"/>
2100     <xsl:call-template name="table.section_sansTopic"/>
2101     <xsl:call-template name="table.bibliography" />
2102   </ul>
2103 </xsl:template>

The case of topics is a bit more complicated. Instead of table.section that shows everything but the composition and the bibliography, we have three parts: the presentations, all modules that have a topics, then modules without topic. The second part is preceded by `View by topics´ and delimited by colored rules.

2104 <xsl:template name="table.matieres_Topic">
2105   <div class="non-topic">
2106     <ul class="tdm_window">
2107       <xsl:call-template name="jg.tdm.members"/>
2108       <li> <xsl:call-template name="presentation_tdm_entry_Topic" /> </li>
2109     </ul>
2110   </div>
2111   <div class="topicIdent">
2112     <br />
2113     <hr class="topic_color" />
2114     View by topics
2115   </div>
2116   <xsl:call-template name="table.topic_Topic">
2117       <xsl:with-param name="class">tdm_window</xsl:with-param>
2118   </xsl:call-template>
2119   <hr class="topic_color" />
2120   <ul class="tdm_window">
2121    <xsl:call-template name="table.section_Topic" />
2122    <li>
2123      <xsl:call-template name="table.bibliography" />
2124    </li>
2125   </ul>
2126 </xsl:template>

This is now the TOC frame. The structure is easy: we have, from top to bottom, the logo, the name of the team, the composition of the team, the presentation, the sections that might have a topic, and the bibliography.

2127 <xsl:template name="tdm_sansTopic">
2128   <div>
2129     <xsl:call-template name="jg.tdm-common"/>
2130     <xsl:call-template name=""/>
2131     <xsl:call-template name="presentation_tdm_entry_sansTopic" />
2132     <xsl:call-template name="table.tdm_sansTopic" />
2133     <xsl:call-template name="table.bibliography" />
2134   </div>
2135 </xsl:template>

In the case of topics, the layout of the page with the frame is the same as the layout of the title page, but there are no rules.

2136 <xsl:template name="tdm_Topic">
2137   <div>
2138     <xsl:call-template name="jg.tdm-common"/>
2139     <xsl:call-template name=""/>
2140     <br />
2141     <xsl:call-template name="presentation_tdm_entry_Topic" />
2142     <xsl:call-template name="acces.topic_Topic" />
2143     <xsl:call-template name="table.topic_Topic">
2144       <xsl:with-param name="class">tdm_frame</xsl:with-param>
2145     </xsl:call-template>
2146     <xsl:call-template name="tdm.section_Topic" />
2147     <xsl:call-template name="table.bibliography" />
2148   </div>
2149 </xsl:template>

The link to the composition of the team in the TOC is constructed via this template.

2150 <xsl:template name="">
2151   <a href="{/raweb/identification/team/@id}.html">
2152      <xsl:call-template name="targetAttrib.main" />
2153      Members
2154   </a>
2155 </xsl:template>

In fact, there are three variants of the previous template: in one case, the team is an item in a list, otherwise, it is in a <div> with class `non-topic´ or `TdmEntry´.

2156 <xsl:template name=""/>
2157   <div class="non-topic">
2158     < name=""/>
2159   </div>
2160 </xsl:template>
2162 <xsl:template name=""/>
2163   <div class="TdmEntry">
2164     < name=""/>
2165   </div>
2166 </xsl:template>
2168 <xsl:template name="jg.tdm.members">
2169   <li>
2170     < name=""/>
2171   </li>
2172 </xsl:template>

The frame TOC is in a <div> element that has a class attribute formed of `tdmdiv´ and optionally `noframe´. It contains the Inria logo with a link to Inria´s home page, and the name of the team.

2173 <xsl:template name="jg.tdm-common"/>
2174   <xsl:attribute name="class">tdmdiv
2175     <xsl:if test="$noframe='1'">noframe</xsl:if>
2176   </xsl:attribute>
2177   <div class="logo">
2178     <a href="">
2179       <xsl:call-template name="targetAttrib.main" />
2180       <img  border="0" src="../icons/logo-inria-.gif" alt="Inria" />
2181     </a>
2182   </div>
2183   <br />
2184   <div class="entete">
2185     <xsl:if test="/raweb/identification[@isproject]='true'">
2186       <xsl:text>Project </xsl:text>
2187     </xsl:if>
2188     <xsl:text>Team </xsl:text>
2189     <xsl:value-of select="/raweb/identification/shortname" />
2190   </div>
2191   <hr />
2192 </xsl:template>

The bibliography is divided into three major parts, and since 2006, these appear in the TOC, unless they are empty.

2193 <xsl:template name="table.bibliography">
2194   <div class="TdmEntry">Bibliography</div>
2195   <div class="TdmEntry">
2196     <ul>
2197       <xsl:if test="//biblio/biblStruct/note[@type='from']='refer'">
2198         <li>
2199           <a id="tdmbibentmajor" href="bibliography.html#Major" >
2200             <xsl:call-template name="targetAttrib.main" />
2201             Major publications
2202           </a>
2203         </li>
2204       </xsl:if>
2205       <xsl:if test="//biblio/biblStruct/note[@type='from']='year'">
2206         <li>
2207           <a id="tdmbibentyear" href="bibliography.html#year">
2208             <xsl:call-template name="targetAttrib.alt" />
2209             Year Publications
2210           </a>
2211         </li>
2212       </xsl:if>
2213       <xsl:if test="//biblio/biblStruct/note[@type='from']='foot'">
2214         <li>
2215            <a id="tdmbibentfoot" href="bibliography.html#Bibliography">
2216              <xsl:call-template name="targetAttrib.main" />
2217              References in notes
2218            </a>
2219         </li>
2220       </xsl:if>
2221     </ul>
2222   </div>
2223 </xsl:template>

In order to make the code easier to understand we have introduced the following templates. It outputs the title, maybe in a <a> or a <li>. The void template is used when the title of a module is empty; in this case the title of the section containing the module is used instead.

2224 <xsl:template name="jg.tdm.basic">
2225    <xsl:call-template name="item_title_or_not_title" />
2226 </xsl:template>
2228 <xsl:template name="jg.tdm.a">
2229   <a> <xsl:call-template name="item_title_or_not_title" /></a>
2230 </xsl:template>
2232 <xsl:template name="">
2233    <li><a><xsl:call-template name="item_title_or_not_title" /></a></li>
2234 </xsl:template>
2236 <xsl:template name="jg.tdm.void">
2237   <li>
2238     <a href="{@id}.html">
2239       <xsl:call-template name="targetAttrib.main" />
2240       <xsl:value-of select="/raweb/presentation/bodyTitle" />
2241     </a>
2242   </li>
2243 </xsl:template>

Same as above, but item_title_or_not_title is not used. Instead, if the value is empty, some other quantity is used (shown here in $varTitle). Attributes of the anchor are computed by table.tdm.xref, and the title is output in `tocsection´ mode.

2244 <xsl:template name="jg.tdm.sans.ali">
2245   <li>
2246     <a>
2247       <xsl:call-template name="targetAttrib.main" />
2248       <xsl:call-template name="table.tdm.xref" />
2249       <xsl:apply-templates mode="tocsection" select="bodyTitle" />
2250     </a>
2251   </li>
2252 </xsl:template>
2254 <xsl:template name="jg.tdm.sans.ali.default">
2255   <li>
2256     <a>
2257       <xsl:call-template name="targetAttrib.main" />
2258       <xsl:call-template name="table.tdm.xref" />
2259       <xsl:apply-templates mode="tocsection" select="{$varTitle}" />
2260     </a>
2261   </li>
2262 </xsl:template>
2264 <xsl:template name="jg.tdm.avec.ali">
2265   <li>
2266     <a name="{@id}" href="{@id}.html#{@id}">
2267       <xsl:call-template name="targetAttrib.main" />
2268       <xsl:apply-templates mode="tocsection" select="bodyTitle" />
2269     </a>
2270   </li>
2271 </xsl:template>

This is not valid XSLT code, but you get the idea. In the case where the presentation section has a single module, its title is very often the same as the section, and we show it only once. The code is the same, with and without topics.

2272 <xsl:template name="jg.tdm.special">
2273   <xsl:when test="count(/raweb/presentation/subsection)=1
2274          and /raweb/presentation/bodyTitle=
2275              /raweb/presentation/subsection/bodyTitle">
2276     <xsl:for-each select="/raweb/presentation/subsection">
2277       <xsl:call-template name="jg.tdm.a" />
2278     </xsl:for-each>
2279   </xsl:when>
2280 </xsl:template>

This is the code for the presentation in the general case with topics. For each module, we print the section title and the module title.

2281 <xsl:template name="jg.tdm.with-topics">
2282   <ul>
2283      <xsl:for-each select="/raweb/presentation/subsection">
2284        <xsl:value-of select="/raweb/presentation/bodyTitle" />
2285        <xsl:call-template name="" />
2286      </xsl:for-each>
2287   </ul>
2288 </xsl:template>

The same without topics. We print the section title (if the module has a fake name) or the module title (otherwise).

2289 <xsl:template name="jg.tdm.without-topics">
2290   <ul>
2291    <xsl:for-each select="/raweb/presentation/subsection">
2292     <xsl:choose>
2293       <xsl:when test="bodyTitle='(Sans Titre)'">
2294         <xsl:call-template name="jg.tdm.void" />
2295       </xsl:when>
2296       <xsl:otherwise>
2297         <xsl:call-template name="" />
2298       </xsl:otherwise>
2299     </xsl:choose>
2300    </xsl:for-each>
2301   </ul>
2302 </xsl:template>

A non-obvious point is: where is the `presentention´ section put in the TOC? In the case with topics, the following template is called, so that, if no module of the section has a topic, it will be output here, otherwise by table.topic_Topic. In the case without topics, it will be presentation_tdm_entry_sansTopic (framed case) table.section_sansTopic (otherwise). Full code of the presentation, case with topics.

2303 <xsl:template name="presentation_tdm_entry_Topic">
2304   <xsl:if test="not(/raweb/presentation/subsection/@topic)">
2305     <div class="non-topic">
2306       <xsl:choose>
2307         <xsl:call-template name="jg.tdm.special" />
2308         <xsl:otherwise>
2309           <xsl:call-template name="jg.tdm.with-topics" />
2310         </xsl:otherwise>
2311       </xsl:choose>
2312     </div>
2313   </xsl:if>
2314 </xsl:template>

Full code of the presentation, case without topics.

2315 <xsl:template name="presentation_tdm_entry_sansTopic">
2316   <div class="TdmEntry">
2317     <xsl:choose>
2318       <xsl:call-template name="jg.tdm.special" />
2319       <xsl:otherwise>
2320         <xsl:value-of select="bodyTitle" />
2321         <xsl:call-template name="jg.tdm.without-topics" />
2322       </xsl:otherwise>
2323      </xsl:choose>
2324   </div>
2325 </xsl:template>

Let´s consider the following sections: <fondements>, <domaine>, <logiciels>, <resultats>, <contrats>, <international>, and <diffusion>, in the case of a frame, without topics. We start with sections that have a module with a topic, and then the other ones; note the <div> element; the CSS says that this element has a different color; it is preceded by a link (created by access.topic) that switches to the alternate view.

2326 <xsl:template name="table.tdm_sansTopic">
2327   <xsl:if test="/raweb/child::*[self::fondements or ...
2328                or self::diffusion]//subsection[@topic]">
2329     <xsl:call-template name="acces.topic"/>
2330     <div class="topic">
2331       <xsl:call-template name="table.maybetopic"/>
2332     </div>
2333   </xsl:if>
2334   <xsl:call-template name="table.maybe-not-topic"/>
2335 </xsl:template>

This is a loop over all sections, only those that have a module with a topic are chosen.

2336 <xsl:template name="table.maybetopic"/>
2337   <xsl:for-each select="/raweb/child::*[self::fondements or ... or self::diffusion]">
2338      <xsl:if test=".//subsection[@topic]">
2339         <xsl:call-template name="table.tdm.entry_sansTopic" />
2340      </xsl:if>
2341   </xsl:for-each>
2342 </xsl:template>

This is a loop over all sections, sections not selected above are selected here.

2343 <xsl:template name="table.maybe-not-topic"/>
2344   <xsl:for-each select="/raweb/child::*[self::fondements or ... or self::diffusion]">
2345      <xsl:if test="not(.//subsection[@topic])">
2346        <xsl:call-template name="table.tdm.entry_sansTopic" />
2347      </xsl:if>
2348   </xsl:for-each>
2349 </xsl:template>

For each section, we output its name, and the modules in it. We simplified the code, by adding a variable, instead of looking at some strange location, in the case when the title of the module is empty.

2350 <xsl:template name="table.tdm.entry_sansTopic">
2351   <xsl:variable name="varTitle" select="bodyTitle" />
2352   <div class="TdmEntry">
2353     <xsl:value-of select="../bodyTitle" />
2354     <ul>
2355       <xsl:for-each select="subsection">
2356        <xsl:choose>
2357          <xsl:when test="./bodyTitle">
2358             <xsl:call-template name="jg.tdm.sans.ali" />
2359          </xsl:when>
2360          <xsl:otherwise>
2361             <xsl:call-template name="jg.tdm.sans.ali" />
2362          </xsl:otherwise>
2363        </xsl:choose>
2364       </xsl:for-each>
2365     </ul>
2366   </div>
2367 </xsl:template>

Assume that the element has id `uid4´. We shall add (to the anchor constructed below), two attributes, href with value `uid4.html?B#tdmBuid4ent´ and id with value `tdmBuid4ent´, where B has to be replaced by some newline character and white space; this seems a bit obscure (the file uid4.html does not contain the string `uid4ent´). In the case table.section, the link will be `uid4.html#uid´, and this is a valid link.

2368 <xsl:template name="table.tdm.xref">
2369    <xsl:attribute name="href">
2370      <xsl:value-of select="@id" />
2371      .html?
2372      <xsl:call-template name="noframe_p" />
2373      #tdm
2374      <xsl:value-of select="@id" />
2375      ent
2376    </xsl:attribute>
2377    <xsl:attribute name="id">
2378      tdm
2379      <xsl:value-of select="@id" />
2380      ent
2381    </xsl:attribute>
2382 </xsl:template>

This outputs the name of the section, and all modules in it. There is a variant that uses instead of, and another one that selects only modules having the same topic (which is in the variable $num-topic)

2383 <xsl:template name="jg.tdm.modules">
2384   <xsl:value-of select="./bodyTitle" />
2385   <ul>
2386     <xsl:for-each select="subsection">
2387       <xsl:call-template name="" />
2388     </xsl:for-each>
2389   </ul>
2390 </xsl:template>
2392 <xsl:template name="jg.tdm.modules.avec">
2393   <!-- Same, but use jg.tdm.avec.ali -->
2394 </xsl:template>
2396 <xsl:template name="jg.tdm.modules.topic">
2397   <!-- Same, but select= "subsection[@topic=$num-topic]"-->
2398 </xsl:template>

This inserts, in topics mode, all sections that have no topics (presentation is excluded here).

2399 <xsl:template name="tdm.section_Topic">
2400   <xsl:for-each select="/raweb/child::*[ self::fondements or ...or self::diffusion]">
2401     <xsl:if test="not(child::subsection/@topic)">
2402       <xsl:call-template name="jg.tdm.modules" />
2403     </xsl:if>
2404   </xsl:for-each>
2405 </xsl:template>

Same code as above, with a <li>. This is used in these case without frame (the previous code was used in the case of frames).

2406 <xsl:template name="table.section_Topic">
2407   <xsl:for-each select="/raweb/child::*[ self::fondements or ...or self::diffusion]">
2408     <xsl:if test="not(child::subsection/@topic)">
2409       <li>
2410         <xsl:call-template name="jg.tdm.modules" />
2411       </li>
2412     </xsl:if>
2413   </xsl:for-each>
2414 </xsl:template>

This considers in the case without frames, without topics, all sections. If the section has a single module, with the same name, we insert the module, otherwise the section name, and all the modules.

2415 <xsl:template name="table.section_sansTopic">
2416   <xsl:for-each select="/raweb/child::*[self::presentation or ... or self::diffusion]">
2417     <xsl:variable name="varTitle" select="bodyTitle" />
2418     <xsl:choose>
2419       <xsl:when test="count(subsection)=1 and ./bodyTitle=subsection/bodyTitle">
2420         <xsl:for-each select="subsection">
2421           <xsl:call-template name="jg.tdm.avec.ali" />
2422         </xsl:for-each>
2423       </xsl:when>
2424       <xsl:otherwise>
2425         <li>
2426            <xsl:call-template name="jg.tdm.modules" />
2427         </li>
2428       </xsl:otherwise>
2429     </xsl:choose>
2430   </xsl:for-each>
2431 </xsl:template>

The structure of the TOC in the case of topics is: for each topic, for each section, for each module, insert an entry. This code takes as parameter $class, that will be used for the <ul>. The current topic name is in $num-topic.

2432 <xsl:template name="table.topic_Topic">
2433   <xsl:param name="class" />
2434   <div class="topic">
2435    <xsl:for-each select="/raweb/topic">
2436      <xsl:variable name="TOP" select="normalize-space(.)" />
2437      <xsl:variable name="num-topic" select="@id" />
2438      <h3 class="smallcap"> <xsl:apply-templates /> </h3>
2439      <ul>
2440         <xsl:attribute name="class">
2441           <xsl:value-of select="$class" />
2442         </xsl:attribute>
2443         <xsl:for-each select="/raweb/child::*[self::presentation or ... or self::diffusion]">
2444           <xsl:call-template name="table.topic.aux" />
2445         </xsl:for-each>
2446       </ul>
2447    </xsl:for-each>
2448   </div>
2449   <br />
2450 </xsl:template>

This template works on a section; if no modules has $num-topic as topic, nothing is done. Otherwise, we have two variables $TOP and $SUB containing the name of the topic, and the title of the module. If they are different, we output all relevant modules. Otherwise, the situation is unclear. Note: assume that the topic is A, its name (value of $TOP) is `foo´, and the test is true, let´s say that modules B and C have A as topic attribute. Then $SUB is the concatenation of the titles of B and C; more than often this will not be `foo´. It might happen that a unique module has topic A, and that this module has the same title as the topic. In this case, you will see the title of the section, and a link to the first module(note: )

2451 <xsl:template name="table.topic.aux">
2452   <xsl:if test="subsection[@topic=$num-topic]">
2453     <xsl:variable name="SUB"
2454       select="normalize-space(subsection[@topic=$num-topic]/bodyTitle)" />
2455     <xsl:choose>
2456       <xsl:when test="$TOP=$SUB">
2457         <li>
2458            <a href="{subsection/@id}.html">
2459               <xsl:value-of select="bodyTitle" />
2460            </a>
2461         </li>
2462      </xsl:when>
2463      <xsl:otherwise>
2464        <li>
2465           <xsl:call-template name="jg.tdm.modules.topic" />
2466       </li>
2467       </xsl:otherwise>
2468   </xsl:choose>
2469  </xsl:if>
2470 </xsl:template>

Are these used?

2471 <xsl:template match="subsection/bodyTitle" mode="sansTopic" />
2472 <xsl:template match="subsection/bodyTitle" mode="Topic" />
2473 <xsl:template match="subsection/bodyTitle" />

This template is used when we construct the page associated to a module. If the module has no topic attribute, we just print the title of its parent (this is the section title). Otherwise, we produce `Topic foo´, `Section bar´, using a <h2> twice.

2474 <xsl:template name="section_title_Topic">
2475     <xsl:choose>
2476       <xsl:when test="./@topic">
2477         <xsl:variable name="VarTop" select="@topic" />
2478         <h2>Topic :
2479         <xsl:value-of select="/raweb/topic[@id=$VarTop]" /></h2>
2480         <h2>Section :
2481         <xsl:value-of select="../bodyTitle" /></h2>
2482       </xsl:when>
2483       <xsl:otherwise>
2484         <h2>Section :
2485         <xsl:value-of select="../bodyTitle" /></h2>
2486       </xsl:otherwise>
2487     </xsl:choose>
2488  </xsl:template>

This is the end of the file.

2489 </xsl:stylesheet>

6.3. Converting the bibliography

This auxiliary file converts the bibliography from the old DTD to the new one.(note: )

2490 <xsl:transform
2491   xmlns:tei=""
2492   xmlns:xsl=""
2493   version="1.0">

Usual header.

2494 <xsl:output method='xml'
2495     doctype-public=""
2496     doctype-system='bibliO.dtd'
2497     indent='no'
2498     encoding='iso-8859-1'/>

We simplified the code, by assuming that the id is `bibliography´. The transformation of <biblio> is an element of the same name. We consider all <citation> elements.

2499 <xsl:template match="biblio">
2500   <xsl:element name="biblio">
2501     <xsl:attribute name="id">bibliography</xsl:attribute>
2502     <xsl:apply-templates select="citation"/>
2503   </xsl:element>
2504 </xsl:template>

Translation of a <citation> element. The result is a <biblStruct>, depending on the type, it can have one of two alternatives (on page , we have the template that converts the entry to HTML, and a comment that says that we check the validity; nothing is done here, we assume that the first or second if-test is true). The last three <note> elements will be used to sort the entries, or for debug.

2505 <xsl:template match="citation">
2506   <xsl:element name="biblStruct">
2507     <xsl:attribute name="id"><xsl:value-of select="./@id"/></xsl:attribute>
2508     <xsl:if test="@type='article' or @type='inbook' or @type='incollection'
2509            or @type='inproceedings' or @type='conference'">
2510         <xsl:call-template name="citation.analy"/>
2511     </xsl:if>
2512     <xsl:if test="@type='book' or @type='booklet' or @type='proceedings' or
2513         @type='phdthesis'  or @type='techreport' or @type='unpublished' or
2514         @type='misc' or @type='masterthesis' or @type='mastersthesis' or
2515         @type='manual'">
2516       <xsl:call-template name="citation.mono"/>
2517     </xsl:if>
2518     <xsl:apply-templates select="bhowpublished"/>
2519     <xsl:element name="note">
2520       <xsl:attribute name="type">classification</xsl:attribute>
2521       <xsl:value-of select="./@type"/>
2522     </xsl:element>
2523     <xsl:element name="note">
2524       <xsl:attribute name="type">from</xsl:attribute>
2525       <xsl:value-of select="./@from"/>
2526     </xsl:element>
2527     <xsl:element name="note">
2528       <xsl:attribute name="type">userid</xsl:attribute>
2529       <xsl:value-of select="./@userid"/>
2530     </xsl:element>
2531   </xsl:element>
2532 </xsl:template>

In order to make this document shorter, we have used the pseudo command “apply-many-templates” in the first version of this document. It happens that such a kind of shorthand exists in XPath 2.0, with the syntax shown here. The next three templates are specific to the TEI.

2533 <xsl:template name="citation.mono">
2534   <xsl:element name="monogr">
2535     <xsl:apply-templates select ="btitle, bbooktitle, bseries, bjournal,
2536       bauteurs, bediteur, bnote, btype, bedition"/>
2537     <xsl:call-template name="imprint"/>
2538   </xsl:element>
2539 </xsl:template>

This is a bit more complicated, because we have three parts <analytic>, <monogr> and <imprint>.

2540 <xsl:template name="citation.analy">
2541   <xsl:element name="analytic">
2542     <xsl:apply-templates select="btitle, bauteurs"/>
2543   </xsl:element>
2544   <xsl:element name="monogr">
2545     <xsl:apply-templates select="bediteur, bbooktitle, bseries,
2546       bjournal, bnote, btype"/>
2547     <xsl:call-template name="imprint"/>
2548   </xsl:element>
2549 </xsl:template>

This is used to indicate how the reference is published.

2550 <xsl:template name="imprint">
2551   <xsl:element name="imprint">
2552     <xsl:apply-templates select="bvolume, bchapter, bnumber,
2553      bpublisher, bschool, borganization, binstitution"/>
2554     <xsl:call-template name="bdate"/>
2555     <xsl:apply-templates select="bpages,xref"/>
2556   </xsl:element>
2557 </xsl:template>

Transformation of the <btitle>. The result is a <title> element, whose attribute depends on the type. We have not shown the value of the second test. Using `choose´ and `otherwise´ would make the code more robust.

2558 <xsl:template match="btitle">
2559   <xsl:if test="../@type='article' or ../@type='inbook' or
2560        ../@type='incollection' or ../@type='inproceedings' or ../@type='conference'">
2561     <title level="a"> <xsl:apply-templates /> </title>
2562   </xsl:if>
2563   <xsl:if test="  ... ">
2564     <title level="m"> <xsl:apply-templates /> </title>
2565   </xsl:if>
2566 </xsl:template>

Transformation of <bauteurs>. The result is a <author>, containing the same list of authors. We translate all the <bpers>, and replace <etal> by a person whose first name is `ETAL´.

2567 <xsl:template match="bauteurs">
2568   <xsl:element name="author">
2569     <xsl:for-each select="bpers|etal">
2570       <xsl:choose>
2571         <xsl:when test="name()='etal'">
2572           <xsl:element name="persName">
2573             <xsl:element name="foreName"><xsl:text>ETAL</xsl:text></xsl:element>
2574           </xsl:element>
2575         </xsl:when>
2576         <xsl:otherwise> <xsl:call-template name="personne"/> </xsl:otherwise>
2577       </xsl:choose>
2578     </xsl:for-each>
2579   </xsl:element>
2580 </xsl:template>

Transformation of <beditor>. The result is a <editor>. What about Mister Etal?

2581 <xsl:template match="bediteur">
2582   <xsl:element name="editor">
2583     <xsl:for-each select="bpers">
2584       <xsl:call-template name="personne"/>
2585     </xsl:for-each>
2586   </xsl:element>
2587 </xsl:template>

Transformation of <bpers> in <persName>. The attributes nom and prenom are translated into <foreName> and <surname>.(note: ) The raweb specification says in 2006 to use full first names, whenever possible, in the bibliography; these are stored by Tralics in the prenomcomplet, copied in <foreName>, and the initials are in <initial>. Note: the actual code uses four <xsl:element> elements instead of literal elements.

2588 <xsl:template name="personne">
2589    <persName>
2590       <foreName>  <xsl:value-of select="@prenomcomplet"/></foreName>>
2591       <surname>  <xsl:value-of select="@nom"/> </surname>
2592       <initial>  <xsl:value-of select="@prenom"/> </initial>
2593     </persName>
2594 </xsl:template>

We replace <bseries> by <title>.

2595 <xsl:template match="bseries">
2596   <title level="s"> <xsl:value-of select="."/>  </title>
2597 </xsl:template>

Ditto for <bjournal>, with a different attribute value.

2598 <xsl:template match="bjournal">
2599   <title level="j"> <xsl:value-of select="."/>  </title>
2600 </xsl:template>

Ditto for <booktitle>. In some cases, we add the value of the <baddress>.

2601 <xsl:template match="bbooktitle">
2602   <title level="m">
2603     <xsl:value-of select="."/>
2604     <xsl:if test="../baddress"> <xsl:text>, </xsl:text><xsl:value-of select="../baddress"/>
2605     </xsl:if>
2606   </title>
2607 </xsl:template>

We replace <bnote> by <note>.

2608 <xsl:template match="bnote">
2609   <note type="bnote"> <xsl:value-of select="."/> </note>
2610 </xsl:template>

Ditto for <btype>, with a different attribute value.

2611 <xsl:template match="btype">
2612   <note type="typdoc"> <xsl:value-of select="."/> </note>
2613 </xsl:template>

Ditto for <bhowpublished>, with a different attribute value.

2614 <xsl:template match="bhowpublished">
2615  <note type="howpublished">  <xsl:value-of select="."/>  </note>
2616 </xsl:template>

The transformation of <bschool> is <publisher>, with an <orgName> that contains the name of the school. It can be followed by the value of the <baddress> field of the entry.

2617 <xsl:template match="bschool">
2618  <xsl:element name="publisher">
2619   <xsl:element name="orgName">
2620    <xsl:attribute name="type">school</xsl:attribute>
2621    <xsl:value-of select="."/>
2622   </xsl:element>
2623   <xsl:if test="../baddress"><xsl:apply-templates select="../baddress"/></xsl:if>
2624  </xsl:element>
2625 </xsl:template>

Same idea here. But the implementation is different.

2626 <xsl:template match="borganization">
2627   <xsl:element name="publisher">
2628     <xsl:element name="orgName">
2629       <xsl:attribute name="type">organisation</xsl:attribute>
2630       <xsl:value-of select="."/>
2631       <xsl:if  test="../baddress">
2632         <xsl:element name="address">
2633           <xsl:apply-templates select="../baddress"/>
2634         </xsl:element>
2635       </xsl:if>
2636     </xsl:element>
2637   </xsl:element>
2638 </xsl:template>

Same idea here.

2639 <xsl:template match="binstitution">
2640   <xsl:element name="publisher">
2641     <xsl:element name="orgName">
2642       <xsl:attribute name="type">institution</xsl:attribute>
2643       <xsl:value-of select="."/>
2644       <xsl:if  test="../baddress">
2645         <xsl:element name="address">
2646           <xsl:apply-templates select="../baddress"/>
2647         </xsl:element>
2648       </xsl:if>
2649     </xsl:element>
2650   </xsl:element>
2651 </xsl:template>


2652 <xsl:template match="bedition">
2653   <xsl:element name="edition">
2654     <xsl:value-of select="./text()"/>
2655     <xsl:copy-of select="./*"/>
2656   </xsl:element>
2657 </xsl:template>

Translation of a date into a <dateStruct>. We take the <bmonth> and <byear> and convert them into <month> and <year>. Nothing is done if both fields are missing.

2658 <xsl:template name="bdate">
2659  <xsl:if test="string-length(bmonth|byear)>0">
2660   <xsl:element name="dateStruct">
2661    <xsl:if test="string-length(bmonth)>0">
2662     <xsl:element name="month"> <xsl:value-of select="bmonth"/> </xsl:element>
2663    </xsl:if>
2664    <xsl:if test="string-length(byear)>0">
2665      <xsl:element name="year"> <xsl:value-of select="byear"/> </xsl:element>
2666    </xsl:if>
2667   </xsl:element>
2668  </xsl:if>
2669 </xsl:template>

Transformation of <bvolume> into a <biblScope>.

2670 <xsl:template match="bvolume">
2671   <biblScope type="volume">  <xsl:value-of select="."/> </biblScope>
2672 </xsl:template>

Transformation of <bchapter> into a <biblScope> with a different attribute value.

2673 <xsl:template match="bchapter">
2674   <biblScope type="chapter">  <xsl:value-of select="."/> </biblScope>
2675 </xsl:template>

Transformation of <bnumber> into a <biblScope> with a different attribute value.

2676 <xsl:template match="bnumber">
2677   <biblScope type="number">  <xsl:value-of select="."/> </biblScope>
2678 </xsl:template>

Transformation of <bpages> into a <biblScope> with a different attribute value.

2679 <xsl:template match="bpages">
2680   <biblScope type="number">  <xsl:value-of select="."/> </biblScope>
2681 </xsl:template>

Transformation of <bpublisher> into a <publisher> containing a <orgName>, and sometimes the address.

2682 <xsl:template match="bpublisher">
2683   <xsl:element name="publisher">
2684     <xsl:element name="orgName">
2685       <xsl:value-of select="."/>
2686       <xsl:apply-templates select="../baddress"/>
2687     </xsl:element>
2688   </xsl:element>
2689 </xsl:template>

Translation of <baddress> into a <address> containing a <addrLine>.

2690 <xsl:template match="baddress">
2691  <xsl:if test="not(../bbooktitle)">
2692    <xsl:element name="address">
2693       <xsl:element name="addrLine"><xsl:value-of select="."/></xsl:element>
2694    </xsl:element>
2695  </xsl:if>
2696 </xsl:template>


2697 <xsl:template match="biblio/citation/xref">
2698  ...
2699 </xsl:template>

This is the end of the file.

2700 </xsl:transform>

6.4. Converting the bibliography into HTML

We explain here what is in the file biblio.xsl that converts the bibliography into HTML code. The input is the result of the translation (code shown in the section above) of what Tralics produces, using a TEI syntax. The full TEI is not yet implemented.

We declare the style sheet and all namespaces.

2701 <xsl:stylesheet
2702   xmlns:tei=""
2703   xmlns:xsl="" version="1.0"
2704   xmlns:m=""
2705   xmlns:xlink=""
2706   xmlns:html=""
2707   exclude-result-prefixes="m html xlink tei">

We remove spaces in most elements.

2708 <xsl:strip-space elements="biblStruct monogr analytic author editor
2709    title imprint address addrLine"/>

In order to make the following code a bit shorter, we replace `note[@type='from']/text()´ with $from and `note[@type='classification']/text()´ with $type. These two quantities are not defined by the TEI, but are used to sort the bibliography. We make a strong assumption: that $from is one of `year´ or `refer´ or `foot´. Entries are sorted by putting `refer´ first and `foot´ last. We assign category `d´ and `k´ to these entries. The second assumption is that $type is one of `article´, `book´, `booklet´, `inbook´, `incollection´, `inproceedings´, `manual´, `masterthesis´, `misc´, `phdthesis´, `proceedings´, `techreport´, `unpublished´. These values are taken from [7, page 763]. Note that BibTeX defines `masterthesis´ and `mastersthesis´ as being equivalent; the companion lists the name with an `s´, Tralics outputs the other one. We accept also `conference´, this is the same as `inproceedings´, `manuel´ (like `manual´, not considered by Tralics) and `coursenotes´. All these entries are classified(note: ): first book, then Ph.D. theses, then articles in journals, then articles in conferences, then technical reports, then anything else. Their type is a letter between `e´ and `j´.

The following code is invalid XSLT, because variables are forbidden in <xsl:key>, but the idea is there. The construction `1 div X´ is a bit strange. There is an example in [4], that explains that it returns 1 in case X is the boolean value true, and infinity otherwise, so that the substring contains one or zero characters. In any case, this associates to each entry a value, that happens to be a single letter, because at most one substring produces a non-empty string.

2710 <xsl:key name="bibliotypes" match="//biblStruct" use="
2711  concat(
2712     substring('d', 1 div ($from='refer')),
2713     substring('e', 1 div ($from='year' and ($type='book' or
2714              $type='booklet' or  $type='proceedings'))),
2715     substring('f', 1 div ($from='year' and ($type='phdthesis'))),
2716     substring('g', 1 div ($from='year' and ($type='article' or
2717             $type='inbook' or $type='incollection'))),
2718     substring('h', 1 div  ($from='year' and ($type='inproceedings' or  $type='conference'))),
2719     substring('i', 1 div ($from='year' and ($type='techreport' or
2720        $type='manuel' or $type='manual' or  $type='coursenotes'))),
2721     substring('j', 1 div ($from='year' and ($type='unpublished' or
2722        $type='misc' or  $type='masterthesis'))),
2723     substring('k', 1 div ($from='foot'))
2724     )" />

Remember that the structure `bibliotypes´ is computed before any global variable is set. As a consequence, we can safely put in a variable the number of entries of each category.

2725 <xsl:variable name='d' select="count(key('bibliotypes', 'd'))"/>
2726 <xsl:variable name='e' select="count(key('bibliotypes', 'e'))"/>
2727 <xsl:variable name='f' select="count(key('bibliotypes', 'f'))"/>
2728 <xsl:variable name='g' select="count(key('bibliotypes', 'g'))"/>
2729 <xsl:variable name='h' select="count(key('bibliotypes', 'h'))"/>
2730 <xsl:variable name='i' select="count(key('bibliotypes', 'i'))"/>
2731 <xsl:variable name='j' select="count(key('bibliotypes', 'j'))"/>
2732 <xsl:variable name='k' select="count(key('bibliotypes', 'k'))"/>

In order to simplify the code that follows, we show here the source of one of the sections. It is a template with three arguments, a type, for instance `f´, a title, and the number of entries before the first of this type.

2733    <xsl:call-template name="tri">
2734      <xsl:with-param name="str" select="'f'"/>
2735      <xsl:with-param name="title" select="'some funny title'"/>
2736      <xsl:with-param name="countPrevious" select="$d+$e"/>
2737    </xsl:call-template>

The sections are in order from d to k, and the titles are respectively: `Major publications by the team in recent years´, `Doctoral dissertations and Habilitation theses´, `Books and Monographs´, `Articles in referred journals and book chapters´, `Publications in Conferences and Workshops´, `Internal Reports´, `Miscellaneous´, `Bibliography in notes´. It was decided, in 2006, to make the origin of the publication more explicit; this means to add `Year Publications´ before entries of type e to j (all but d and k), and to use a smaller font for the subtitles. For this reason, the template shown above has an additional parameter, `title2´ that is the subtitle. We shall abreviate the previous template as tri(´f´, $d+$e, ´Tit-f´,”), using the third title in the list; the last element in the list is the subtitle (one of `title´ or `title2´ is empty).

The variable $except-publis contains a list of sections that should be omitted. Hence the previous count is a bit more complicated that just computing the sum of $d and $e. For instance, this is the code that computes the first number for section f.

2738  <xsl:variable name="countPrevF">
2739    <xsl:choose>
2740      <xsl:when test="contains($except-publis,'e')">
2741         <xsl:value-of select="$countPrevE" />
2742      </xsl:when>
2743      <xsl:otherwise>
2744         <xsl:value-of select="$countPrevE + $e" />
2745      </xsl:otherwise>
2746    </xsl:choose>
2747  </xsl:variable>

In order to make the code shorter, we have abbreviated the previous template as update-count(countPrevF, ´e´, countPrevE). There is something strange in the code shown here: only section d is conditionally included.

2748 <xsl:template name="tri-par-publis">
2749   <xsl:param name="except-publis" />
2750   <div class="publis">
2751     <xsl:if test="not( contains($except-publis,'d') )">
2752       tri('d', '0', 'Tit-d', '')
2753     </xsl:if>
2754     update-count(countPrevE, d, 0)
2755     <a name="year"><h2>Year Publications</h2></a>
2756     tri('e', countprevE, '', 'Tit-e')
2757     update-count(countPrevF, e, countprevE)
2758     tri('f', countPrevF, '', 'Tit-f')
2759     update-count(countPrevG, f, countprevF)
2760     tri('g', countPrevG, '', 'Tit-g')
2761     update-count(countPrevH, g, countprevG)
2762     tri('h', countPrevH, '', 'Tit-h')
2763     update-count(countPrevI, h, countprevH)
2764     tri('i', countPrevI, '', 'Tit-i')
2765     update-count(countPrevJ, i, countprevI)
2766     tri('j', countPrevJ, '', 'Tit-j')
2767     update-count(countPrevK, k, countprevJ)
2768     tri('k', countPrevK, 'Tit-k', '')
2769   </div>
2770 </xsl:template>

What the code does is obvious: we consider all entries that are of type $str. If the list is empty, nothing is done. Otherwise, the $title is output in a <h2>, or $title2 is output in a <h4>. Note that this code can produce two anchors: `Major´ and `References´. After that, we output all elements of the list, sorted by author´s name. The template that outputs the entry takes a number: it is the index of the entry, the value of $countPrevious plus the index in the sorted list.

2771 <xsl:template name="tri">
2772   <xsl:param name="str"/>
2773   <xsl:param name="title"/>
2774   <xsl:param name="title2"/>
2775   <xsl:param name="countPrevious"/>
2776   <xsl:if test="key('bibliotypes',$str)[1]">
2777     <xsl:if test="string-length($title)>0">
2778        <a name="{substring-before($title,' ')}">
2779          <h2><xsl:value-of select='$title'/></h2>
2780        </a>
2781     </xsl:if>
2782     <xsl:if test="string-length($title2)>0">
2783       <h4><xsl:value-of select='$title2'/></h4>
2784     </xsl:if>
2785     <dl>
2786     <xsl:for-each select="key('bibliotypes',$str)">
2787        <xsl:sort select="descendant::author[1]/persName[1]/surname/text()"/>
2788        <xsl:apply-templates select=".">
2789           <xsl:with-param name="pos">
2790             <xsl:value-of select="$countPrevious+position()"/>
2791           </xsl:with-param>
2792        </xsl:apply-templates>
2793     </xsl:for-each>
2794     </dl>
2795   </xsl:if>
2796 </xsl:template>

This is used more than once, hence we introduced this template (this is not valid XSL code, because it uses an undeclared variable $pos, which is declared by the caller).

2797 <xsl:template name="jp.pos">
2798     <xsl:text>[</xsl:text>
2799     <xsl:value-of select="$pos"/>
2800     <xsl:text>]</xsl:text>
2801 </xsl:template>

This template exists in two versions: the version given here terminates if the type is not in the list given above (code omitted). It converts a <biblStruct> into a <dt>, that contains an anchor, the number and key of the reference, and a <dd> that contains the reference. A non trivial point concerns punctuation. The idea is that there is a period after the list of authors, and at the end of the citation. Each item is preceded by a comma, except the author list (that is at the start of an entry) or the title (that comes after the authors).

2802 <xsl:template match="biblStruct">
2803   <xsl:param name="pos" select= "position()"/>
2804   <xsl:check-this-entry />
2805   <dt class="bib">
2806     <xsl:call-template name="jg.pos" />
2807     <xsl:text>[</xsl:text>
2808     <xsl:value-of select="note[@type='userid']"/>
2809     <xsl:text>]</xsl:text>
2810     <a name="{./@id}"></a>
2811   </dt>
2812   <dd> <xsl:apply-templates/> <xsl:text>.</xsl:text> </dd>
2813   <xsl:text>&#x0a;</xsl:text>
2814 </xsl:template>

Same code as above, with the following modifications; the user-id field is omitted (this is the cite key of the LaTeX source, it has nothing to do in the HTML file, but is useful for debug). On the other hand, if the $xyleme variable is set, a different anchor is used (the year string should be changed to 2006).

2815 <xsl:template match="biblStruct" mode="debug">
2816  <xsl:param name="pos" select="position()" />
2817  <dt class="bib">
2818   <xsl:choose>
2819     <xsl:when test="$xyleme='1'">
2820      <a name="{./@id}" class="ancre" title="référence en bibtex"
2821        href="../../2004/publiLatex.text?ref={./@id}&amp;projet={$projet}">
2822       <xsl:call-template name="jg.pos" />
2823      </a>
2824     </xsl:when>
2825     <xsl:otherwise>
2826      <a name="{./@id}" class="ancre">
2827      <xsl:call-template name="jg.pos" />
2828     </xsl:otherwise>
2829   </xsl:choose>
2830  </dt>
2831  <dd>  <xsl:apply-templates/><xsl:text>.</xsl:text> </dd>
2832 </xsl:template>

Most entries are trivial: a comma and the content. The case of <edition> is special: the LaTeX companion says that the value should be something like `Second´. There is no such problem for <orgName> or <addrLine>.

2833 <xsl:template match="edition|orgName|addrLine">
2834   <xsl:text>, </xsl:text> <xsl:apply-templates/>
2835 </xsl:template>

Translation of <biblScope>. This depends on the type attribute. In the case `volume´, we output something like “vol. 25”.

2836 <xsl:template match="biblScope[@type='volume']">
2837   <xsl:text>, vol.&#xa0;</xsl:text> <xsl:apply-templates/>
2838 </xsl:template>

In the case `chapter´, we output something like “chap. 25”.

2839 <xsl:template match="biblScope[@type='chapter']">
2840   <xsl:text>, chap.&#xa0;</xsl:text> <xsl:apply-templates/>
2841 </xsl:template>

In the case `number´, we output something like “no 25”.

2842 <xsl:template match="biblScope[@type='number']">
2843   <xsl:text>, n</xsl:text><sup>o</sup><xsl:text>&#xa0;</xsl:text>
2844   <xsl:apply-templates/>
2845 </xsl:template>

In the case of `pages´ we output something like “p. 10–30”. If the text contains neither a dash nor an en-dash, we outpout “42 p”.

2846 <xsl:template match="biblScope[@type='pages'][text()!='']">
2847   <xsl:text>, </xsl:text>
2848   <xsl:choose>
2849     <xsl:when test="string-length(substring-before(., '-'))
2850                 or string-length(substring-before(., '&#8211;'))>0">
2851        <xsl:text>p. </xsl:text>
2852        <xsl:apply-templates/>
2853     </xsl:when>
2854     <xsl:otherwise>
2855       <xsl:apply-templates/>
2856       <xsl:text> p</xsl:text>
2857     </xsl:otherwise>
2858   </xsl:choose>
2859 </xsl:template>

Translation of <note>. This is trivial, but used only if the type attribute is `bnote´ (a BibTeX note), `typdoc´ (this could be the type of a report) or `howpublished´ (for a non-standard entry).

2860 <xsl:template match="note[@type='howpublished' | @type='bnote' | @type='typdoc']">
2861     <xsl:text>, </xsl:text>
2862     <xsl:apply-templates/>
2863 </xsl:template>

These notes are used for sorting, their printed value is empty.

2864 <xsl:template match="note[@type='from' |@type='userid' | @type='classification']">
2865 </xsl:template>

Translation of <title>. Is this really needed?

2866 <xsl:template match="title[ancestor::biblio]">
2867    <xsl:text>"</xsl:text> <xsl:apply-templates/><xsl:text>"</xsl:text>
2868 </xsl:template>

Translation of <title>. The attribute says that it is the name of a journal.

2869 <xsl:template match="title[@level='j']">
2870   <xsl:text>, in: </xsl:text>
2871   <span class="journal"> <xsl:apply-templates/> </span>
2872 </xsl:template>

Translation of <title>. The attribute says that it is the name of a series.

2873 <xsl:template match="title[@level='s']">
2874   <xsl:text>, </xsl:text> <xsl:apply-templates/>
2875 </xsl:template>

Translation of <title>. The attribute says that it is the title of an article, a book, or something like that. The result is a <span> with an attribute that says to use a different font.

2876 <xsl:template match="title[@level='a']">
2877    <span class="journal"> <xsl:apply-templates/> </span>
2878 </xsl:template>

Translation of <title>. The attribute says that it is something different than the cases considered above. The TEI says something like: If the title appears directly enclosed within an <analytic> element, the level, if given, must be `a´; if it appears directly enclosed within a <monogr> element, level must be `m´, `j´, or `u´; when <title> is directly enclosed by <series>, level must be `s´. As a consequence, if the test is true, we have two titles (for instance a book title, and the title of a part of the book).

2879 <xsl:template match="title[@level='m']">
2880   <xsl:choose>
2881     <xsl:when test="string-length(../../analytic/title) > 0">
2882       <xsl:text>, in: </xsl:text>
2883       <span class="journal"><xsl:apply-templates/></span>
2884     </xsl:when>
2885     <xsl:when test="string-length(../..//author) > 0
2886              and string-length(../..//editor) > 0 ">
2887       <xsl:text>, </xsl:text>
2888       <span class="journal"> <xsl:apply-templates/> </span>
2889     </xsl:when>
2890     <xsl:otherwise>
2891       <span class="journal"> <xsl:apply-templates/>  </span>
2892     </xsl:otherwise>
2893   </xsl:choose>
2894 </xsl:template>

Translation of <author>. We consider all <persName> in the list, typesetting them one after the other with a comma as separator, and a period at the end. There is a <br> at the end of the list. A special case is when the first name is ETAL. Otherwise, we output the forename (either initials in <intial> or whatever is in <foreName>) and the <surname>.

2895 <xsl:template match="author">
2896  <xsl:for-each select="persName">
2897    <xsl:choose>
2898      <xsl:when test="foreName='ETAL'">
2899         <small><xsl:text>et al.</xsl:text></small>
2900      </xsl:when>
2901      <xsl:otherwise>
2902        <xsl:choose>
2903          <xsl:when test="initial">
2904            <xsl:apply-templates select="initial"/>
2905          </xsl:when >
2906          <xsl:otherwise>
2907            <xsl:apply-templates select="foreName"/>
2908          </xsl:otherwise>
2909        </xsl:choose>
2910         <xsl:value-of select="foreName"/>
2911         <xsl:text> </xsl:text>
2912         <xsl:apply-templates select="surname" />
2913         <xsl:call-template name="separateur.objet"/>
2914      </xsl:otherwise>
2915    </xsl:choose>
2916  </xsl:for-each>
2917  <br/>
2918 </xsl:template>

The translation of <editor> is similar. If an author and an editor are given, they are separated by a comma (remember that there is a line break after the authors). We add a <br> at the end in the case where no author is given. Editors are separated by commas, but at the end, we put a `(editor)´ or `(editors)´ remark.

2919 <xsl:template match="editor">
2920  <xsl:if test="../..//author">
2921    <xsl:if test="ancestor-or-self/node()/title[@level='a']">
2922      <xsl:text>, </xsl:text>
2923    </xsl:if>
2924  </xsl:if>
2925  <xsl:for-each select="persName">
2926    <xsl:choose>
2927      <xsl:when test="foreName='ETAL'">
2928        <small><xsl:text>et al.</xsl:text></small>
2929      </xsl:when>
2930      <xsl:otherwise>
2931        <xsl:choose>
2932          <xsl:when test="initial">
2933            <xsl:apply-templates select="initial"/>
2934          </xsl:when >
2935          <xsl:otherwise>
2936            <xsl:apply-templates select="foreName"/>
2937          </xsl:otherwise>
2938        </xsl:choose>
2939        <xsl:text> </xsl:text>
2940        <xsl:apply-templates select="surname" />
2941        <xsl:call-template name="separateurED.objet"/>
2942      </xsl:otherwise>
2943    </xsl:choose>
2944  </xsl:for-each>
2945  <xsl:text> (editor</xsl:text><xsl:call-template name="pluriel-p">
2946       <xsl:with-param name="liste" select="persName" /></xsl:call-template>
2947  <xsl:text>).</xsl:text>
2948  <xsl:if test="not(../../*/author)"><br/></xsl:if>
2949 </xsl:template>

This is used in the case where a name (say Dupont) appears as an autor or editor in the bibliography. We put in in a with `smallcaps´ attribute. Moreover, if is true, and the author is member of the Team (there is a <person> with <lastname> Dupont), an anchor is created, with value root/Publications/2006/publications.html?name=Dupont&projet=apics.

2950 <xsl:template match="surname">
2951   <span class="smallcap">
2952     <xsl:choose>
2953       <xsl:when test="$xyleme='1'
2954            and //person/lastname[text()=current()/text()]">
2955         <a>
2956           <xsl:attribute name="href">
2957             <xsl:value-of select="$rootUrl"/>
2958             /Publications/
2959             <xsl:value-of select="$year" />
2960             /publications.html?name=
2961             <xsl:apply-templates/>&amp;projet=
2962             <xsl:value-of select="$projet" />
2963           </xsl:attribute>
2964           <xsl:apply-templates />
2965         </a>
2966       </xsl:when>
2967       <xsl:otherwise>
2968         <xsl:apply-templates />
2969       </xsl:otherwise>
2970     </xsl:choose>
2971   </span>
2972 </xsl:template>

This seems to be useless.

2973 <xsl:template match="bedition"> ? </xsl:template>

Case of a <dateStruct>. We output the <month> and the <year>.

2974 <xsl:template match="dateStruct">
2975   <xsl:text>, </xsl:text>
2976   <xsl:value-of select="month"/><xsl:text> </xsl:text><xsl:value-of select="year"/>
2977 </xsl:template>

Case of <publisher>. We output the two parts: <orgName> and optionally <address>.

2978 <xsl:template match="publisher">
2979   <xsl:apply-templates select="orgName"/>
2980   <xsl:if test="./address"><xsl:apply-templates select="address"/> </xsl:if>
2981 </xsl:template>

Case of <address>. No initial comma. This is commented out in the 2006 version.

2982 <xsl:template match="address">
2983   <xsl:apply-templates/>
2984 </xsl:template>

Case of a reference. We assume that it is always an external reference. Moreover, the program that converts from the old DTD to the new one never adds a url attribute(note: ). The essential difference between the two cases is that a <br> is added before the link.

2985 <xsl:template match="biblStruct//ref">
2986   <xsl:choose>
2987    <xsl:when test="./@url">
2988      <a>
2989        <xsl:attribute name="target">_alt</xsl:attribute>
2990        <xsl:attribute name="href"><xsl:value-of select="./@url"/></xsl:attribute>
2991        <xsl:apply-templates/>
2992      </a>
2993    </xsl:when>
2994    <xsl:otherwise>
2995       <xsl:text>, </xsl:text>
2996       <br/>
2997       <a>
2998         <xsl:attribute name="target">_alt</xsl:attribute>
2999         <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
3000         <xsl:apply-templates/>
3001       </a>
3002    </xsl:otherwise>
3003   </xsl:choose>
3004 </xsl:template>

Case of <analytic>. We output <author>, <title>, <editor>, and <imprint>. If no author is given the editor is put before the title.

3005 <xsl:template match="analytic">
3006   <xsl:apply-templates select="author"/>
3007   <xsl:choose>
3008     <xsl:when test="author">
3009       <xsl:apply-templates select="title"/>
3010       <xsl:apply-templates select="editor"/>
3011     </xsl:when>
3012     <xsl:otherwise>
3013       <xsl:apply-templates select="editor"/>
3014       <xsl:apply-templates select="title"/>
3015     </xsl:otherwise>
3016   </xsl:choose>
3017  <xsl:apply-templates select="imprint"/>
3018 </xsl:template>

Case of <monogr>. We output <title>, <author>, and <editor>, in some strange order, followed by <note>, <edition> and <imprint>.

3019 <xsl:template match="monogr">
3020  <xsl:choose>
3021   <xsl:when test="../analytic">
3022     <xsl:apply-templates select="title[@level='m']"/>
3023     <xsl:apply-templates select="title[@level='j']"/>
3024     <xsl:apply-templates select="author"/>
3025     <xsl:apply-templates select="editor"/>
3026     <xsl:apply-templates select="title[@level='s']"/>
3027   </xsl:when>
3028   <xsl:otherwise>
3029     <xsl:apply-templates select="author"/>
3030     <xsl:apply-templates select="editor"/>
3031     <xsl:apply-templates select="title"/>
3032    </xsl:otherwise>
3033  </xsl:choose>
3034  <xsl:apply-templates select="note"/>
3035  <xsl:apply-templates select="edition"/>
3036  <xsl:apply-templates select="imprint"/>
3037 </xsl:template>

Case of <imprint>. We output <publisher>, <dateStruct>, <biblScope>, and <ref>.

3038 <xsl:template match="imprint">
3039   <xsl:apply-templates select="publisher"/>
3040   <xsl:apply-templates select="dateStruct"/>
3041   <xsl:apply-templates select="biblScope"/>
3042   <xsl:apply-templates select="ref"/>
3043 </xsl:template>

Consider the following piece of code; call it position-in-bib(W), where W can be a letter between d and k. Each 'd' should be replaced by W, and "0" by the sum of $d, $e, etc, up to, but excluded $W.

3044   <xsl:when test="count($curelement|key('bibliotypes', 'd'))
3045                 =count(key('bibliotypes', 'd'))">
3046     <xsl:call-template name="positionInBib">
3047       <xsl:with-param name="str" select="'d'" />
3048       <xsl:with-param name="current" select="$curelement" />
3049       <xsl:with-param name="countPrevious" select="0" />
3050     </xsl:call-template>
3051   </xsl:when>

Here the test compares two values, count(A|B) and count(B). The test is true if A is in B (A is a node, B is a node-set, count(A|B) is the union of B and the set that contains only A). Such a construct is given as an example in [4] under the entry <xsl:key>. It happens that bibliography entries are sorted, by type, a type is a letter between d and k, and, for each type, by author. Consider the n-th item, let´s call it X; question: what is n? Assume that the entry is of type m, and there are p entries of type less than m; if this entry is the q-th of type m, then n=p+q. All entries of type m can be found using key, with argument `bibliotypes´ and m. The test in the routine above is then: is $curelement of type `e´? If so, we call the template with three arguments: $str that holds the type, $current the entry to test, and $countPrevious the quantity p. The variable $d holds the number of entries of type `d´, it is computed on line 2728. Thus, we obtain p by adding some of $d, $e, $f, $g, $h, $i, and $j (the quantity $k is not used). Computing q is not trivial: we have a function that computes the index of the current node Y in a list, it is the position() function. We want the position of X, we obtain it by concatenation of all f(Y), where f(Y) is the position of Y if Y is X, empty otherwise. The nodes X and Y are the same if they have the same unique id, not if they have the same text. Normally, the number created here is the same as the one computed on line 2750 (the number associated to the entry), it is created for each reference to the bibliography.

3052 <xsl:template name="positionInBib">
3053   <xsl:param name="str" />
3054   <xsl:param name="countPrevious" />
3055   <xsl:param name="current" />
3056   <xsl:for-each select="key('bibliotypes',$str)">
3057     <xsl:sort select="descendant::author[1]/persName[1]/surname/text()" />
3058     <xsl:if test="generate-id(.)=generate-id($current)">
3059        <xsl:value-of select="$countPrevious+position()" />
3060     </xsl:if>
3061   </xsl:for-each>
3062 </xsl:template>
3063 <xsl:template match="ref" mode="ref2biblio">
3064     <xsl:param name="curelement" />
3065     <a>
3066       <xsl:attribute name='href'>
3067         <xsl:call-template name="formaturl">
3068           <xsl:with-param name="base" select="'bibliography'" />
3069         </xsl:call-template>
3070         <xsl:value-of select="@xlink:href" />
3071       </xsl:attribute>
3072       <xsl:text>[</xsl:text>
3073       <xsl:choose>
3074          position-in-bib(d)
3075          position-in-bib(e)
3076          position-in-bib(f)
3077          position-in-bib(g)
3078          position-in-bib(h)
3079          position-in-bib(i)
3080          position-in-bib(j)
3081          position-in-bib(k)
3082          <xsl:otherwise>
3083            <xsl:message>Ooops reference non trouvee</xsl:message>
3084          </xsl:otherwise>
3085       </xsl:choose>
3086       <xsl:text>]</xsl:text>
3087    </a>
3088 </xsl:template>

This is the end of the file.

3090 </xsl:stylesheet>

6.5. Helper style sheets

We describe here two style sheets, verif-aut.xsl and verif-membres.xsl. The purpose of these two style sheets is to produce small HTML files, containing the list of authors, cited in the bibliography, with their cite key, or the list of members of the team, with their affiliations; this allows authors to quickly check typos in their document.

We shall not show all details, like attributes of the <xsl:stylesheet> element, they are similar to those shown elsewhere in this document. The verif-aut.xsl file contains a rule for the top-level element, that says to consider only the bibliography.

3091 <xsl:template match="/raweb">
3092   <xsl:apply-templates select="biblio" />
3093 </xsl:template>

The result is a simple HTML file. It contains a title, and an anchor to the second file, and a list, whose content will be explained later.

3094 <xsl:template match="biblio">
3095  <html>
3096    <head>
3097      <title>Verification des auteurs référencés dans la bibliographie </title>
3098      <style type="text/css">
3099        h1 {font-weight:bold;font-size:16pt;}
3100        dt {font-weight:bold;color:blue;}
3101      </style>
3102    </head>
3103    <body>
3104     <h1>Les auteurs référencés dans la bibliographie</h1>
3105     <a href="membres-{$projet}.html">Voir les membres de l'équipe</a> <!--$-->
3106      <dl>
3107 ...
3108      </dl>
3109    </body>
3110  </html>
3111 </xsl:template>

This piece of code selects all <persName> elements; these are authors or editors. Consider such a person X, with first name A, last name B; we sort these persons, alphabetically, on the last name, then first name. We consider the bibliography entry Y that has X as author or editors (this is a <biblStruct>) and its cite key C (this is one of <note> children of Y), and output it. Quantities A and B are also printed, but only once.

3112  <xsl:for-each select="//persName">
3113    <xsl:sort select="surname"/>
3114    <xsl:sort select="foreName"/>
3115    <xsl:if test="current()[generate-id(.)
3116                =generate-id(key('authorslist',surname)[1])]">
3117     <dt>
3118       <xsl:apply-templates select="surname"/>
3119       <xsl:text>, </xsl:text> <xsl:value-of select="foreName"/>
3120     </dt>
3121    </xsl:if>
3122    <dd>
3123      <xsl:apply-templates
3124         select="ancestor::biblStruct/note[@type='userid']"/>
3125    </dd>
3127  </xsl:for-each>

This piece of code constructs a `key´, an association list, that associates to each author or editor X its last name B. Said otherwise, key(´authorslist´, B) gives the list <persName> whose last name is B. If this list is L, then generate-id(L[1]) is the unique id of the first X with last name B. Assume that there is only one person named B, and that its first name is always given identically; then the test shown above will output the name of the person before its first reference (otherwise, it will be put randomly because of the second sort instruction).

3128 <xsl:key name="authorslist"
3129      match="//biblio//persName"
3130      use="surname" />

Action is trivial here.

3131 <xsl:template match="note">
3132   <xsl:apply-templates />
3133 </xsl:template>
3135 <xsl:template match="surname">
3136   <xsl:apply-templates />
3137 </xsl:template>

The second style sheet is similar. It constructs an HTML page, with a link to the first one.

3138 <xsl:template match="/raweb">
3139   <html>
3140     <head>
3141       <title>Verification des membres de l'équipe</title>
3142       <style type="text/css">
3143          h1 {font-weight:bold;font-size:16pt;color:blue;}
3144          table {border :2px solid blue;border-collapse:collapse;}
3145          tr {border :1px solid blue;padding:5px;}
3146          td {border :1px solid blue;padding:5px;}
3147         td.head {font-weight:bold;border :1px solid red;padding:5px;
3148                background-color:#ffe3d1;}
3149       </style>
3150     </head>
3151     <body>
3152       <h1>Les membres de l'équipe avec les catégories et affiliations</h1>
3153       <a href="auteurs-{$projet}.html">  <!-- $ emacs -->
3154          Les auteurs référencés dans la bibliographie
3155       </a>
3156 ...
3157     </body>
3158  </html>
3159 </xsl:template>

The firt item in the file is the number of people entitled to supervise PhD students. It is just the number of <hdr> elements.

3160  <p>Nombre de personnes habilitées à diriger des recherches :
3161     <span style="font-weight:bold;">
3162       <xsl:value-of select="count(//hdr)"/>
3163     </span>
3164  </p>

Then comes a table, with a header and one line for each team member.

3165  <table>
3166   <tr>
3167     <td class="head">Nom</td>
3168     <td class="head">Affiliation</td>
3169     <td class="head">Catégorie profession</td>
3170     <td class="head">Habilité</td>
3171   </tr>
3172   <xsl:apply-templates select="//team/participants/person"/>
3173 </table>

The important point here is to output the <categoryPro> and affiliation, since they do not appear in the normal HTML file.

3174 <xsl:template match="person">
3175   <tr>
3176     <td>
3177       <xsl:apply-templates select="firstname"/>
3178       <xsl:text> </xsl:text>
3179       <xsl:apply-templates select="lastname"/></td>
3180     <td><xsl:apply-templates select="categoryPro"/></td>
3181     <td><xsl:apply-templates select="affiliation"/></td>
3182     <td><xsl:apply-templates select="hdr"/></td>
3183   </tr>
3184 </xsl:template>
3186 <xsl:template match="firstname|lastname|affiliation|profession">
3187   <xsl:apply-templates />
3188 </xsl:template>

We consider now a last style sheet rawebindex.xsl that creates an index. It defines some variables, for instance, $LeProjet, containing the team name. The main template template here is the following. Note that the output method is plain text.

3189 <xsl:template match="raweb">
3190   <xsl:document href="{$LeProjet}_mcl" method="text" encoding="iso-8859-1">
3191     <xsl:call-template name="keywords"/> <!-- $emacs -->
3192   </xsl:document>
3193 </xsl:template>

A rule is applied to each section.

3194 <xsl:template name="keywords">
3195   <xsl:apply-templates select="/raweb/composition"   mode="mkindex"/>
3196   <xsl:apply-templates select="/raweb/presentation"  mode="mkindex"/>
3197   <xsl:apply-templates select="/raweb/fondements"    mode="mkindex"/>
3198   <xsl:apply-templates select="/raweb/domaine"       mode="mkindex"/>
3199   <xsl:apply-templates select="/raweb/logiciels"     mode="mkindex"/>
3200   <xsl:apply-templates select="/raweb/resultats"     mode="mkindex"/>
3201   <xsl:apply-templates select="/raweb/contrats"      mode="mkindex"/>
3202   <xsl:apply-templates select="/raweb/international" mode="mkindex"/>
3203   <xsl:apply-templates select="/raweb/diffusion"     mode="mkindex"/>
3204 </xsl:template>

The code starts by computing a variable in a strange way; we simplified it a bit; it is the name of the current section (for instance, `Scientific Foundation´). For each keyword, for instance `Rational Approximation´, we convert it to upper case. In order to make the code shorter, we have written `S´ instead of `ancestor-or-self::subsection´. If we have a section A, with a subsection B, with a subsection C, with a keyword D, then `S´ contains C and D (in document order), but the last element on this ancestor-or-self axis is C. If the of this selement is uid14, and the team is Apics, this piece of code prints a line of the form MCL:RATIONAL APPROXIMATION:apics/uid14.html:Team : Apics - Scientific Foundations - Identification and deconvolution. Here the last item is the title of subsection B, it is omitted when equal to A (modulo case, in all three cases, the two strings given to translate have 26 characters.)

3205 <xsl:template match="composition|presentation|fondements|domaine|
3206        logiciels|resultats|contrats|international|diffusion"
3207      mode="mkindex" >
3208   <xsl:variable name="SECTION">
3209     <xsl:value-of select="bodyTitle" />
3210   </xsl:variable>
3211   <xsl:for-each select="subsection">
3212     <xsl:for-each select=".//keyword">
3213       <xsl:text>MCL:</xsl:text>
3214       <xsl:value-of select="normalize-space(translate(.,'q','Q'))"/>
3215       <xsl:text>:</xsl:text>
3216       <xsl:value-of select="$LeProjet"/>
3217       <xsl:text>/</xsl:text>
3218       <xsl:value-of select="S[position()=last()]/@id"/>
3219       <xsl:text>.html:Team : </xsl:text>
3220       <xsl:value-of select="$PROJET"/><xsl:text> - </xsl:text>
3221       <xsl:value-of select="$SECTION"/>
3223       <xsl:variable name="toto" select="translate(S/bodyTitle,'Q','q')"/>
3224       <xsl:variable name="toti" select="translate($SECTION,'Q','q')"/>
3225       <xsl:if test="$toto!=$toti">
3226        <xsl:text> - </xsl:text>
3227        <xsl:apply-templates select="S[position()=last()]/bodyTitle"/>
3228       </xsl:if>
3229       <xsl:text>&#x0a;</xsl:text>
3230     </xsl:for-each>
3231   </xsl:for-each>
3232 </xsl:template>

6.6. The raweb CSS style sheet

We describe here the content of the file raweb.css, containing rendering information for the Raweb. Recall the syntax: we have a keyword K, followed by an open brace, a sequence of properties, and a closing brace. A property is a name, a colon, a value, and a semi-colon as a separator.

If the keyword K is a name, this is the name of the element. Here we say that the <body> element (this is the whole HTML page) should have a white background, black foreground, and the font should be Helvetica, or Arial, or some other sans-serif font.

3233 body {
3234     background-color:#ffffff;
3235     color:#000000;
3236     font-family: Helvetica, Arial,sans-serif }

If the keyword K contains a dot (say `´), then it applies if the element <foo> has `bar´ as style. The following rule says that the <body> of the TOC has a different background color.

3237 body.tdm {
3238     background-color:#DDDDDD;
3239     color:#000000;
3240     font-family: Helvetica, Arial,sans-serif }

These rules indicate the size of the headings, <h1>, <h2>, <h3>, <h4>, and <h5>.

3241 h1 { font-size : 150% }
3242 h2 { font-size : 140% }
3243 h3 { font-size : 130% }
3244 h4 { font-size : 110% ; font-style: italic }
3245 h5 { font-size : 90% ;}

These lines (as well as following lines with keywords in capital letters) were in the original style sheet, created by latex2html; they are not used anymore. The idea is the following: Translation of \huge is a <big> element, with style `huge´. A browser that understands CSS will use a `larger´ font, a browser that does not understand CSS will use the font associated to <big>. By default, Tralics knows only three sizes of fonts (normal, small and large).

3246 SMALL.XTINY             { font-size : xx-small; }
3247 SMALL.TINY              { font-size : x-small;  }
3248 SMALL.SCRIPTSIZE        { font-size : smaller;  }
3249 SMALL.FOOTNOTESIZE      { font-size : small ;   }
3250 BIG.XLARGE              { font-size : large ;   }
3251 BIG.XXLARGE             { font-size : x-large;  }
3252 BIG.HUGE                { font-size : larger ;  }
3253 BIG.XHUGE               { font-size : xx-large; }

If the keyword has the form `.bar´ or `*.bar´, it applies to every element with class `bar´. The rules here explain how to locally change the font properties.

3254 .smaller{ font-size : smaller   }
3255 .small  { font-size : small    }
3256 .large  { font-size : large    }
3257 .bold   { font-weight : bold    }
3258 .it     { font-style : italic    }
3259 *.center     { text-align:center }
3260 *.smallcap     { font-variant:small-caps; }

More properties for the <span> element. The last rule applies in the case where the lement is <a> in a <span> with style `keyword´.

3261 SPAN.textit             { font-style: italic  }
3262 SPAN.textbf             { font-weight: bold  }
3263 span.keyword            { font-style: italic  }
3264 span.keyword a          { font-style: italic  }

These properties apply to the header of the page, containing the navigation buttons; the first page is white, other are light grey. The first page has a thin border, which has the same color as the big rule that separates the metadata and the TOC (the color is some kind of pink).

3265 .premiere     { background-color:#ffffff ;
3266                 color:#000000 ;
3267                 border-width: 1px;
3268                 border-color: #D60098;
3269                 border-style:solid solid solid solid ;
3270                 height: 70px;
3271                 padding: 0px 5px 0px 5px
3272               }
3273 .autre     {  background-color:#dddddd ; height: 70px;}
3274 .rose {background-color: #D60098; height:3px}

Properties for math. The first three lines are from latex2html, not used anymore (if Tralics sees a font change in a math formula, it constructs a MathML element that will be converted into an image. If the formula needs an equation number, a table will be constructed, in order to get correct alignment. Cells in this table have no border.

3275 .MATH    { font-family: "Century Schoolbook", serif; }
3276 .MATH I  { font-family: "Century Schoolbook", serif; font-style: italic }
3277 .BOLDMATH { font-family: "Century Schoolbook", serif; font-weight: bold }
3278 div.mathdisplay table { border:none }
3279 div.mathdisplay td    { border:none }
3280 div.mathdisplay tr    { border:none }

Figures are generally centered via the use of tables; in these cases we set border and margin to zero. The with of the outer table is 80 percent of the whole page (why?)

3281 table.objectContainer       {  border:none; width:80%; margin:0; }
3282 table.objectContainer td    {  border:none; margin:0;  }
3283 table.objectContainer tr    {  border:none; margin:0;  }
3284 table.objectContainer table {  border:none; }
3285 caption {font-size:80%; padding-bottom:10px;}

By default, we show border of tables.

3286 td    { border:1px solid}
3287 tr    { border:1px solid}
3288 table { border:1px solid; empty-cells:show;  border-collapse:collapse; }

A <ul> in a <dd> is indented by one em (this is strange: what about other lists (dl or ol) inside items of other list, such as li). There are now two rules for <dt> elements in the bibliography (containing a cite key). This element is to be shown in a bold font. The next rule has the form `´, it applies to every `gee´ element preceded by a `foo´ with style bar. The rule has a negative margin-top, not shown here, because the cite key is overwritten by the author list. We have three rules for list items in the TOC frame.

3289 dd ul { margin-top:1em;}
3290 dt.bib  { display: inline; font-weight: bold; }
3291 dt.bib + dd { vertical-align:top;  margin-bottom: 1em; }
3292 ul.tdm_windows {  }
3293 ul.tdm_frame {margin-top:0px;margin-bottom:10px;}
3294 li.tdm_frame {margin-left:-10px;}

These two rules explain how `Keywords´ and `Participants´ should be printed. Currentlt, they are underlined.

3295 *.KW {  text-decoration: underline }
3296 *.part { text-decoration: underline }

These are unused.

3297 .journal { font-style: italic }
3298 *.xyHighlight { background-color: yellow;}

The following rules explain how to render the buttons that are on the top right part of the page. A rule of the form #foo applies to every element that has and id attribute with value `foo´. A rule of the form #foo:bar applies if this element has status `bar´; here the element is an anchor, and we specify how the color of the anchor should changed when visited, etc.

3299 .folderButtons {
3300     position:absolute;
3301     background-color:#BCBCF9 ;
3302     top:14px;right:12px ;height: 60px ;width: 180px }
3303 .folderLine    { color: #000000 }
3304 .folderText {font-size : smaller; text-align:right; }
3305 #folderIconRef         { border:0px ;float:left; }
3306 #folderIconRef:link    { color:#dddddd; }
3307 #folderIconRef:visited { color:#dddddd; }

Six rules that say where to put navigation buttons (left, right, center, or top, bottom).

3308 #head_adroite    {  float:right; }
3309 #head_agauche    {  float:left;  }
3310 #head_aucentre   {  text-align:center ; width:70% ;font-size : smaller;}
3311 #tail_agauche    {  float:left ; }
3312 #tail_adroite    {  float:right; }
3313 #tail_aucentre   {  text-align:center; width:100%; }

Four rules that appear in the TOC frame, make the distinction between topics and non-topics obvious. Call these C, F, CT and FT. In the case without topics, we will have C followed by T, otherwise FT followed by CT. The first element is left aligned, the second is right aligned. The C and CT have a lighter color than the F and FT.

3314 #clair   {
3315     background-color:#BCBCF9; width:48% ; height:20px;
3316     float:left; border-style:solid solid none solid ;border-width:thin ;
3317     text-align:center;font-size : smaller;}
3318 #fonce   {
3319    background-color:#594FBF; width:48%  ; height:20px;
3320    float:right; border-style:solid;border-width:thin ;
3321    text-align:center;font-size : smaller;}
3322 #clair_T {
3323    background-color:#BCBCF9; width:48% ; height:20px;
3324    float:right; border-style:solid solid none solid ;border-width:thin ;
3325    text-align:center;font-size : smaller;}
3326 #fonce_T {
3327    background-color:#594FBF; width:48% ; height:20px;
3328    float:left; border-style:solid;border-width:thin ;
3329    text-align:center;font-size : smaller;}

This is for the logo at the bottom of the page. The text has attribute `display:none´, so that you will not see it, unless the browser cannot show the image, and uses the text instead.

3330 #bandeau {
3331   clear: both;
3332   width: 100%;
3333   height: 90px;
3334   background-color: #594FBF;
3335   background-image: url(icons/bandeau_g.gif);
3336   background-repeat: no-repeat;
3337   text-align:right;}
3338 #bandeau_logo {
3339    float: right;
3340    height: 90px;
3341    width: 329px;
3342    padding: 0px;
3343    background: url(icons/bandeau_d.gif);}
3344 #logotext {  display: none }

This is for the logo on the TOC frame.

3345 *.logo { background-color:#594FBF; color: #FFFFFF;  text-align:center; }

Other rules use for the TOC frame.

3346 *.topic_color  {  color: green; }
3347 div.bigspace   { margin-top:3em; margin-bottom:3em; }
3348 div.entete     { text-align:center; font-weight:bold; }
3349 div.tdmdiv     { position:fixed;top:0;left:0;clear:both;
3350   background-color:#dddddd;width:100%; overflow:scroll;max-height: 100% }
3351 div.noframe    { width:20%; }
3352 div.tdmdiv + div + div#main        { margin-left:21%; }
3353 div.tdmdiv + #toplign              { margin-left:20%; width:80%; }
3354 *.non-topic  { margin-bottom:-1em; padding-top:0em;
3355     padding-right:1em;  padding-bottom:0em;}
3356 *.topic      { border-width:thin ; border-color:black;
3357                border-style:none solid solid solid; }
3358 *.topicIdent { color:green; text-align:right ; }
3359 div.topic {background-color:#BCBCF9; color: #FFFFFF; padding: 5px 5px 0px 0px;}
3360 table.topic  { background-color:#BCBCF9;  color: #FFFFFF;}

More rules.

3361 #bouton  { padding:0em  }
3362 .NavigationIcones {margin:4px 0px 0px 0px; }
3363 #recherche { float:right }
3364 #toclink {  display:none }
3365 div.aucentre p   {  text-align:center; }
3366 p { }

These are unused.

3367 #corpsdroit a:hover div {  color: #fff; background-color: #369; text-decoration: none;}
3368 #bandeau_titre { height: 90px; border : 1px; }
3369 #annuel { float: left; margin-left:150px; height: 90px; width: 329px;
3370    padding: 0px; background: url(icons/pochette.png); }
3371 *.tdmActPage { background-color:red;  }
3372 div.boutonf  { font-size : smaller; color : #FFFFFF; background-color:#BCBCF9; }
Back to main page