Ignore:
Timestamp:
04/16/08 11:15:20 (16 years ago)
Author:
pinsard
Message:

migration from DocBook? 4 to Docbook 5 : sources and production tools

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Documentation/xmldoc/all_plots_docbook.xsl

    r191 r345  
    1 <?xml version="1.0" encoding="iso-8859-1" ?> 
     1<?xml version="1.0" encoding="iso-8859-1"?> 
     2<xsl:stylesheet 
     3version="1.0" 
     4xmlns:dbk="http://docbook.org/ns/docbook" 
     5xmlns:xl="http://www.w3.org/1999/xlink" 
     6xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
    27<!-- 
    3 module :  
     8module : 
    49generation of a docbook file for display all plots of firtsteps.xml 
    510 
     
    813 
    914update : 
     15fplod 2008-04-15T12:40:25Z aedon.locean-ipsl.upmc.fr (Darwin) 
     16adaptation to docbook 5 in and out 
    1017fplod 2006-05-17T09:59:52Z aedon.lodyc.jussieu.fr (Darwin) 
    1118fplod 2006-09-21T14:58:05Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    1320--> 
    1421 
    15 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
    1622 
    17 <xsl:output  
    18  method="xml"  
    19  indent="yes"  
    20  encoding="iso-8859-1" 
    21  omit-xml-declaration="no" 
    22  doctype-public="-//OASIS//DTD DocBook XML V4.2//EN" 
    23  doctype-system="http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"/> 
     23<xsl:output 
     24 method="xml" 
     25 indent="yes" 
     26 omit-xml-declaration="no"/> 
    2427 
    25  <xsl:template match="article">  
    26   <article id="all_plots" lang="en"> 
     28<xsl:template match="/"> 
     29 <xsl:element name="article"> 
     30 <xsl:attribute name="version">5.0</xsl:attribute> 
     31 <xsl:attribute name="xmlns">http://docbook.org/ns/docbook</xsl:attribute> 
     32 <xsl:attribute name="xml:lang">en</xsl:attribute> 
     33 <xsl:attribute name="xml:id">all_plots</xsl:attribute> 
     34 
    2735  <title>All plots of SAXO demo</title> 
    28     <articleinfo> 
     36    <info> 
    2937    <authorgroup> 
    30       <author><firstname>Sébastien</firstname> <surname>Masson</surname> <email>smasson_at_lodyc.jussieu.fr</email></author> 
    31       <author><firstname>Françoise</firstname> <surname>Pinsard</surname> <email>Francoise.Pinsard_at_lodyc.jussieu.fr</email></author> 
     38      <author><personname><firstname>Sébastien</firstname> <surname>Masson</surname></personname> <email>smasson_at_lodyc.jussieu.fr</email></author> 
     39      <author><personname><firstname>Françoise</firstname> <surname>Pinsard</surname></personname> <email>Francoise.Pinsard_at_lodyc.jussieu.fr</email></author> 
    3240    </authorgroup> 
    3341    <keywordset> 
     
    3543      <keyword>SAXO</keyword> 
    3644    </keywordset> 
    37     </articleinfo> 
    38     <sect1 id="intro"> 
     45    </info> 
     46    <sect1 xml:id="intro"> 
    3947    <title>Introduction</title> 
    4048    <para> 
    41       This page gathers all plots used in <ulink url="firststeps.html">firststeps</ulink> and display them in one unique page to facilitate the search of plots examples. 
     49      This page gathers all plots used in <link xl:href="firststeps.html">firststeps</link> and display them in one unique page to facilitate the search of plots examples. 
    4250    </para> 
    4351    </sect1> 
    44     <sect1 id="allplots"> 
     52    <sect1 xml:id="allplots"> 
    4553    <title>All plots</title> 
     54     <xsl:element name="itemizedlist"> 
    4655 
    47 <!-- for all ulink where url is something .png 
    48 plot it with the title of the closest ancestor which have an id attibutes 
     56<!-- for all links where xl:href is something .png 
     57plot it with the title of the closest ancestor which have an xml:id attribute 
    4958--> 
    50 <xsl:for-each select="self::node()/descendant-or-self::node()/child::ulink[contains(@url,'png')]"> 
    51   <xsl:sort order="ascending" data-type="text" select="@url"/> 
     59<!-- version dbk 4 pour mémoire 
     60<xsl:for-each select="self::node()/descendant-or-self::node()/child::link[contains(@xl:href,'png')]"> 
     61--> 
     62<xsl:for-each select="//dbk:link[contains(@xl:href,'png')]"> 
     63  <xsl:sort order="ascending" data-type="text" select="@xl:href"/> 
    5264  <xsl:call-template name="plot"> 
    53       <xsl:with-param name="url" select="@url"/> 
    54       <xsl:with-param name="id" select="(ancestor-or-self::node()/@id)[last()]"/> 
    55       <xsl:with-param name="title" select="(ancestor-or-self::node()/title)[last()]"/> 
     65      <xsl:with-param name="href" select="@xl:href"/> 
     66      <xsl:with-param name="id" select="(ancestor-or-self::node()/@xml:id)[last()]"/> 
     67      <xsl:with-param name="title" select="(ancestor-or-self::node()/dbk:title)[last()]"/> 
    5668  </xsl:call-template> 
    5769</xsl:for-each> 
     70   </xsl:element> 
    5871  </sect1> 
    59   </article> 
    60  </xsl:template>  
     72  </xsl:element> 
     73</xsl:template> 
    6174 
    62     <xsl:template name="plot">  
    63         <xsl:param name="url"/>   
    64         <xsl:param name="id"/>   
    65         <xsl:param name="title"/>   
    66         <xsl:element name="para"> 
    67         <xsl:element name="mediaobject"> 
     75    <xsl:template name="plot"> 
     76        <xsl:param name="href"/> 
     77        <xsl:param name="id"/> 
     78        <xsl:param name="title"/> 
     79        <xsl:element name="listitem"> 
     80         <xsl:element name="para"> 
     81          [plot <xsl:value-of select="$href"/>] 
     82         </xsl:element>  
     83         <xsl:element name="para"> 
     84          <xsl:element name="mediaobject"> 
    6885            <xsl:element name="imageobject"> 
    6986                <xsl:element name="imagedata"> 
    70                     <xsl:attribute name="fileref"><xsl:value-of select="$url"/></xsl:attribute> 
     87                    <xsl:attribute name="fileref"><xsl:value-of select="$href"/></xsl:attribute> 
    7188                    <xsl:attribute name="format">PNG</xsl:attribute> 
    7289                    <xsl:attribute name="valign">top</xsl:attribute> 
    7390                </xsl:element> 
    7491            </xsl:element> 
     92            <xsl:element name="textobject"> 
     93             <xsl:element name="phrase"> 
     94              [plot <xsl:value-of select="$href"/>] 
     95             </xsl:element> 
     96            </xsl:element> 
     97            <xsl:element name="caption"> 
     98             <xsl:element name="para"> 
     99              cf.  
     100              <xsl:element name="link"> 
     101               <xsl:attribute name="xl:href">firststeps.html#<xsl:value-of select="$id"/></xsl:attribute> 
     102                <xsl:value-of select="$title"/> 
     103              </xsl:element> 
     104              <xsl:text> in </xsl:text><xsl:value-of select="//dbk:title"/> 
     105             </xsl:element> 
     106            </xsl:element> 
     107           </xsl:element> 
     108          </xsl:element> 
    75109        </xsl:element> 
    76         <xsl:element name="textobject"> 
    77             <xsl:element name="phrase"> 
    78                 [plot <xsl:value-of select="$url"/>] 
    79             </xsl:element> 
    80         </xsl:element> 
    81         <xsl:element name="caption"> 
    82             <xsl:element name="para"> 
    83             cf. <xsl:element name="ulink"> 
    84 <!-- 
    85                     <xsl:attribute name="url">firststeps.html#<xsl:value-of select="$id"/></xsl:attribute> 
    86 --> 
    87                     <xsl:attribute name="url">firststeps.html#<xsl:value-of select="$id"/></xsl:attribute> 
    88                 <xsl:value-of select="$title"/> 
    89                 </xsl:element> 
    90                 <xsl:text>in First steps with SAXO</xsl:text> <!--++ récupérer le titre de l'article --> 
    91             </xsl:element> 
    92         </xsl:element> 
    93         </xsl:element> 
    94     </xsl:template>  
     110    </xsl:template> 
    95111 
    96112</xsl:stylesheet> 
Note: See TracChangeset for help on using the changeset viewer.