Changeset 151


Ignore:
Timestamp:
02/28/12 18:08:25 (12 years ago)
Author:
pinsard
Message:

progress on rest procesing

Location:
trunk
Files:
1 added
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/biblioentry_rest.xsl

    r150 r151  
    88 
    99<!-- 
    10 module : 
    11 traitement d'une référence bibliographique (biblioentry) 
    12  
    13 update : 
     10 
     11DESCRIPTION 
     12=========== 
     13 
     14traitement d'une référence bibliographique (biblioentry) en ReST 
     15 
     16EVOLUTIONS 
     17========== 
     18 
    1419$Id$ 
    15 fplod 2008-05-15T09:18:54Z aedon.locean-ipsl.upmc.fr (Darwin) 
    16 correction on separators between authors for bibtex 
    17 fplod 2008-05-14T08:51:10Z aedon.locean-ipsl.upmc.fr (Darwin) 
    18 introducting bibtex (latex) output 
    19 fplod 2008-05-13T15:24:49Z aedon.locean-ipsl.upmc.fr (Darwin) 
    20 add parameter type (default raw) 
    21 fplod 2008-05-13T09:17:14Z aedon.locean-ipsl.upmc.fr (Darwin) 
    22 bibliomisc is written after biblioid 
    23 fplod 2008-05-07T09:06:53Z aedon.locean-ipsl.upmc.fr (Darwin) 
    24 improvements for conference 
    25 fplod 2008-05-06T09:35:00Z aedon.locean-ipsl.upmc.fr (Darwin) 
    26 add category choices 
    27 fplod 2008-04-29T15:41:56Z aedon.locean-ipsl.upmc.fr (Darwin) 
    28 chgt for dbk5 in 
    29 fplod 2008-04-29T09:10:31Z aedon.locean-ipsl.upmc.fr (Darwin) 
    30 chgt for dbk5 out 
    31 fplod 2007-06-20T17:18:02Z aedon.locean-ipsl.upmc.fr (Darwin) 
    32 <bibliomisc role="id"> replaced by <biblioid class="doi"> 
    33 fplod 2007-05-16T14:01:44Z aedon.locean-ipsl.upmc.fr (Darwin) 
    34 correction in order to write doi only once 
    35 fplod 2007-05-16T10:27:34Z aedon.locean-ipsl.upmc.fr (Darwin) 
    36 remove biblioentry/date and publisher 
    37 add biblioentry/biblioset/bibliomisc 
    38 fplod 2007-05-15T07:37:46Z aedon.locean-ipsl.upmc.fr (Darwin) 
    39 factorisation de biblioentry 
    40 fplod 2007-05-14T15:48:04Z aedon.locean-ipsl.upmc.fr (Darwin) 
    41 correction to add biblioentry/date (replace biblioentry/biblioset/pubdate) 
    42 when "in press" 
    43 fplod 2007-05-04T07:59:34Z aedon.locean-ipsl.upmc.fr (Darwin) 
    44 factorisation de bibnemomaf01_xml.xsl, bibnemomaf02_xml.xsl,bibnemomaf04_xml.xsl 
     20 
     21$URL$ 
     22 
     23- fplod 20120228 
     24   
     25  * creation from biblioentry_rest.xsl  
     26 
    4527--> 
    4628 
     
    4931<xsl:include href="message_lang.xsl"/> 
    5032 
    51 <xsl:template name="one_biblioentry"> 
     33<xsl:template name="one_biblioentry_rest"> 
    5234 <xsl:param name="visu_modif"/> 
    5335 <xsl:param name="type"/> 
     
    416398 
    417399<xsl:template match="d:biblioentry/d:title" mode="raw"> 
    418  <xsl:text> : </xsl:text> 
    419  <xsl:value-of select="normalize-space(.)"/> 
     400 <xsl:text> : *</xsl:text> 
     401 <xsl:value-of select="normalize-space(.)"/> 
     402 <xsl:text>*</xsl:text> 
    420403</xsl:template> 
    421404 
     
    438421 
    439422<xsl:template match="d:biblioset[@relation='conference']/d:title" mode="raw"> 
    440  <xsl:text>, </xsl:text> 
    441  <xsl:value-of select="normalize-space(.)"/> 
     423 <xsl:text>, *</xsl:text> 
     424 <xsl:value-of select="normalize-space(.)"/> 
     425 <xsl:text>*</xsl:text> 
    442426</xsl:template> 
    443427 
     
    525509<xsl:template match="d:biblioid[@class='uri']" mode="raw"> 
    526510 <xsl:text>, </xsl:text> 
    527  <xsl:element name="link"> 
    528   <xsl:attribute name="xl:href"><xsl:value-of select="normalize-space(.)"/></xsl:attribute> 
    529  </xsl:element> 
     511 <xsl:value-of select="normalize-space(.)"/> 
    530512</xsl:template> 
    531513 
     
    548530 <xsl:text> : </xsl:text> 
    549531 <xsl:value-of select="normalize-space(.)"/> 
    550  <xsl:text>}</xsl:text> 
    551 </xsl:template> 
    552  
    553 <xsl:template match="d:biblioid[@class='doi']" mode="bibtex"> 
    554    <xsl:choose> 
    555     <xsl:when test=". = '???'"> 
    556      <xsl:message> iii : no doi found for 
    557       <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/> 
    558      </xsl:message> 
    559     </xsl:when> 
    560     <xsl:otherwise> 
    561      <!-- ++ transformer 10.1029/2003GL018906 en un lien sur http://dx.doi.org/10.1029/2003GL018906 par exemple 
    562   --> 
    563       <xsl:text>, doi = {</xsl:text> <!-- ++ pas sûre, peut-être seulement note = {doi:..} --> 
    564       <xsl:value-of select="normalize-space(.)"/> 
    565     </xsl:otherwise> 
    566    </xsl:choose> 
    567532 <xsl:text>}</xsl:text> 
    568533</xsl:template> 
     
    577542    <xsl:otherwise> 
    578543     <!-- transformer 10.1029/2003GL018906 en un lien sur http://dx.doi.org/10.1029/2003GL018906 par exemple --> 
    579      <xsl:text>, </xsl:text> 
    580      <xsl:element name="link"> 
    581       <xsl:attribute name="xl:href"> 
    582        <xsl:text>http://dx.doi.org/</xsl:text> 
     544     <xsl:text>,`</xsl:text> 
    583545       <xsl:value-of select="normalize-space(.)"/> 
    584       </xsl:attribute> 
    585       <xsl:text>doi:</xsl:text><xsl:value-of select="normalize-space(.)"/> 
    586      </xsl:element> 
     546       <xsl:text> &lt;http://dx.doi.org/</xsl:text><xsl:value-of select="normalize-space(.)"/><xsl:text>&gt;`_</xsl:text> 
    587547    </xsl:otherwise> 
    588548   </xsl:choose> 
  • trunk/makefile

    r150 r151  
    2525# 
    2626# - fplod 20120227 
    27 #    
     27# 
    2828#   * move demo1 and nemo1 in tests 
    2929# 
     
    3232#   * add "Check SUPERBIB requirements in main.xml : " usage of checkmain.sh 
    3333#     only procedure instructions 
    34 #    
     34# 
    3535# - fplod 20110701T105417Z cratos.locean-ipsl.upmc.fr (Linux) 
    3636# 
     
    140140--param generate.section.toc.level '0' \ 
    141141--param citerefentry.link '1' 
     142 
     143XSLPARAMRST = \ 
     144--param makedate "'$(MAKEDATE)'" 
    142145 
    143146IMAGES = \ 
     
    329332 
    330333$(DIRSPHINX)/$(PRODUCT)01.rst : \ 
    331 $(DIRTMP)/$(PRODUCT)01.xml \ 
     334$(DIRTMP)/biblio.xml \ 
    332335$(DIRWWW)/images/years.png \ 
    333 $(DIRSRC)/$(PRODUCT).css \ 
    334 $(DIRSRC)/style.css \ 
    335336$(DIRSRC)/$(PRODUCT)01_rest.xsl \ 
     337$(DIRSRC)/biblioentry_rest.xsl \ 
    336338$(DIRSRC)/db_rest.xsl \ 
    337339$(DIRSRC)/message_lang.xsl \ 
    338340$(DIRTMP)/titlepage.$(PRODUCT).xsl 
    339341        @xsltproc \ 
    340         $(XSLPARAMHTML) \ 
     342        $(XSLPARAMRST) \ 
    341343        --output $@ \ 
    342344        $(DIRSRC)/$(PRODUCT)01_rest.xsl \ 
     
    369371$(DIRSPHINX)/$(PRODUCT)02.rst : \ 
    370372$(DIRTMP)/$(PRODUCT)02.xml \ 
    371 $(DIRSRC)/$(PRODUCT).css \ 
    372 $(DIRSRC)/style.css \ 
    373 $(DIRSRC)/$(PRODUCT)01_rest.xsl \ 
     373$(DIRSRC)/$(PRODUCT)02_rest.xsl \ 
     374$(DIRSRC)/biblioentry_rest.xsl \ 
    374375$(DIRSRC)/db_rest.xsl \ 
    375376$(DIRSRC)/message_lang.xsl \ 
    376377$(DIRTMP)/titlepage.$(PRODUCT).xsl 
    377378        @xsltproc \ 
    378         $(XSLPARAMHTML) \ 
    379         --output $@ \ 
    380         $(DIRSRC)/$(PRODUCT)01_rest.xsl \ 
     379        $(XSLPARAMRST) \ 
     380        --output $@ \ 
     381        $(DIRSRC)/$(PRODUCT)02_rest.xsl \ 
    381382        $< 
    382383 
     
    394395        $< 
    395396 
    396 $(DIRSPHINX)/$(PRODUCT)02/ :  
     397$(DIRSPHINX)/$(PRODUCT)02/ : 
    397398        @echo "not yet" 
    398399 
     
    442443        $< 
    443444 
    444 $(DIRSPHINX)/$(PRODUCT)01/ :  
     445$(DIRSPHINX)/$(PRODUCT)01/ : 
    445446        @echo "not yet" 
    446447 
     
    568569 
    569570$(DIRTMP)/main_full.xml : \ 
    570 $(DIRSRC)/main.xml \ 
     571$(DIRTMP)/main.xml \ 
    571572$(DIRSRC)/select_form.php \ 
    572573$(DIRTMP)/select_id.xml 
     
    589590$(DIRSPHINX)/user.rst: \ 
    590591$(DIRTMP)/user_db.xml \ 
    591 $(DIRSRC)/db_rest.xsl \ 
    592592$(DIRSRC)/user_rest.xsl \ 
    593593$(DIRSRC)/message_lang.xsl \ 
     
    595595$(DIRSRC)/form_rest.xsl 
    596596        @xsltproc \ 
    597         $(XSLPARAMHTML) \ 
     597        $(XSLPARAMRST) \ 
    598598        --output $@ \ 
    599599        $(DIRSRC)/user_rest.xsl \ 
  • trunk/superbib01_rest.xsl

    r116 r151  
    1 <?xml version='1.0' encoding='ISO-8859-1'?> 
     1<?xml version="1.0" encoding="iso-8859-1"?> 
    22<xsl:stylesheet 
     3version="1.0" 
    34xmlns:d="http://docbook.org/ns/docbook" 
    4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    5 version="1.0"> 
     5xmlns:xl="http://www.w3.org/1999/xlink" 
     6xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
    67 
    78<!--rst 
    89 
    9 .. _superbib01_rest.xsl: 
    10  
    11 =================== 
    12 superbib01_rest.xsl 
    13 =================== 
    14  
    15 transformation docbook en un rest 
     10.. _superbib01_xml.xsl: 
     11 
     12================== 
     13superbib01_xml.xsl 
     14================== 
     15 
     16produce a DocBook 5 with bibliograhy references sorted by years 
     17 
     18SEE ALSO 
     19======== 
     20 
     21:ref:`biblioentry_rest.xsl` 
    1622 
    1723TODO 
    1824==== 
    1925 
    20 make it work 
     26link sur top chaque section 
     27:ref:`top` ../../images/globalicondl11x10_up.gif 
     28 
     29tableau d'années 
    2130 
    2231EVOLUTIONS 
     
    2433 
    2534$Id$ 
    26 $URL$ 
    27  
    28 - fplod 20110629T131028Z aedon.locean-ipsl.upmc.fr (Darwin) 
    29  
    30   * création 
     35 
     36- fplod 2001228 
     37 
     38  * recreation 
    3139 
    3240--> 
    3341 
    34 <xsl:import href="db_rest.xsl"/> 
    35  
    36 <xsl:output method="text"/> 
    37  
    38 <xsl:include href="titlepage.superbib.xsl"/> 
    39 <xsl:include href="message_lang.xsl"/> 
    40  
    41 <xsl:template match="*" mode="book.titlepage.mode"/> 
    42 <xsl:param name="generate.toc"> 
    43 article nop 
    44 </xsl:param> 
    45 <xsl:param name="css.decoration" select="0"/> 
    46 <xsl:param name="section.autolabel" select="0"/> 
    47  
     42<xsl:output 
     43 method="text" 
     44 indent="yes"/> 
     45 
     46<xsl:include href="biblioentry_rest.xsl"/> 
     47 
     48<xsl:variable name="list_years" select="///d:pubdate[not( self::node() = following::d:pubdate )]"/> 
     49 
     50<xsl:variable name="project"> 
     51 <xsl:value-of select="document('main.xml')//d:keyword[@xml:id='project']"/> 
     52</xsl:variable> 
     53 
     54<xsl:template name="years"> 
    4855<!-- 
    49 Personalisation de bas de page 
     56creation of an informatable of nb years 
     57each entry of the table is a link #year_xxxx 
    5058--> 
    51 <xsl:template name="user.footer.content"> 
    52  <xsl:call-template name="para_lastupdate"> 
    53   <xsl:with-param name="language" select="/article/@xml:lang"/> 
    54   <xsl:with-param name="date" select="$makedate"/> 
    55   <xsl:with-param name="mode" select="'rest'"/> 
    56  </xsl:call-template> 
    57  
    58  <hr/> 
    59  <para> 
    60  <xsl:call-template name="back"> 
    61   <xsl:with-param name="language" select="/article/@xml:lang"/> 
    62  </xsl:call-template> 
    63  <xsl:text> </xsl:text> 
    64  <xsl:element name="a"> 
    65   <xsl:attribute name="href"> 
    66    <xsl:value-of select="document('main.xml')//d:bibliosource[@xml:id='homepage']"/> 
    67   </xsl:attribute> 
    68   <xsl:value-of select="document('main.xml')//d:keyword[@xml:id='project']"/> home page 
     59<xsl:element name="informaltable"> 
     60 <xsl:attribute name="xml:id">years</xsl:attribute> 
     61 <xsl:attribute name="summary">years of publications</xsl:attribute> 
     62 <xsl:element name="tgroup"> 
     63  <xsl:variable name="nb_cols" select="count($list_years)"/> 
     64  <xsl:attribute name="cols"><xsl:value-of select="$nb_cols"/></xsl:attribute> 
     65  <xsl:attribute name="align">center</xsl:attribute> 
     66  <xsl:attribute name="colsep">1</xsl:attribute> 
     67  <xsl:attribute name="rowsep">1</xsl:attribute> 
     68  <xsl:for-each select="///d:pubdate[not( self::node() = following::d:pubdate )]"> 
     69   <xsl:sort order="descending" data-type="number" select="."/> 
     70   <xsl:element name="colspec"> 
     71    <xsl:attribute name="colname">year_<xsl:value-of select="."/></xsl:attribute> 
     72   </xsl:element> 
     73  </xsl:for-each> 
     74  <xsl:element name="tbody"> 
     75   <xsl:element name="row"> 
     76    <xsl:for-each select="///d:pubdate[not( self::node() = following::d:pubdate )]"> 
     77     <xsl:sort order="descending" data-type="number" select="."/> 
     78     <xsl:element name="entry"> 
     79      <xsl:attribute name="colname"><xsl:text>year_</xsl:text><xsl:value-of select="."/></xsl:attribute> 
     80      <xsl:element name="link"> 
     81       <xsl:attribute name="xl:href"><xsl:text>#year_</xsl:text><xsl:value-of select="."/></xsl:attribute> 
     82       <xsl:value-of select="."/> 
     83      </xsl:element> 
     84     </xsl:element> 
     85    </xsl:for-each> 
     86   </xsl:element> 
     87   <xsl:element name="row"> 
     88    <xsl:for-each select="///d:pubdate[not( self::node() = following::d:pubdate )]"> 
     89     <xsl:sort order="descending" data-type="number" select="."/> 
     90     <xsl:element name="entry"> 
     91      <xsl:attribute name="colname"><xsl:text>year_</xsl:text><xsl:value-of select="."/></xsl:attribute> 
     92      <xsl:element name="emphasis"> 
     93       <xsl:attribute name="role">bold</xsl:attribute> 
     94<xsl:variable name="nb_current"> 
     95 <xsl:variable name="current_year"><xsl:value-of select="."/></xsl:variable> 
     96 <xsl:value-of select="count(/descendant::d:biblioentry[child::d:biblioset[child::d:pubdate=$current_year]])"/> 
     97</xsl:variable> 
     98       <xsl:value-of select="$nb_current"/> 
     99      </xsl:element> 
     100     </xsl:element> 
     101    </xsl:for-each> 
     102   </xsl:element> 
     103   <xsl:variable name="year_min"> 
     104    <xsl:value-of select="///d:pubdate[not(. &gt; ///d:pubdate)]"/> 
     105   </xsl:variable> 
     106   <xsl:variable name="year_max"> 
     107    <xsl:value-of select="///d:pubdate[not(. &lt; ///d:pubdate)]"/> 
     108   </xsl:variable> 
     109   <xsl:element name="row"> 
     110    <xsl:element name="entry"> 
     111     <xsl:attribute name="namest"><xsl:value-of select="concat('year_',$year_max)"/></xsl:attribute> 
     112      <xsl:attribute name="nameend"><xsl:value-of select="concat('year_',$year_min)"/></xsl:attribute> 
     113     <xsl:element name="emphasis"> 
     114      <xsl:attribute name="role">bold</xsl:attribute> 
     115       <xsl:value-of select="count(/descendant::d:biblioentry)"/> 
     116     </xsl:element> 
     117    </xsl:element> 
     118   </xsl:element> 
    69119  </xsl:element> 
    70   </para> 
    71  
     120 </xsl:element> 
     121</xsl:element> 
    72122</xsl:template> 
    73123 
     124<xsl:template match="d:bibliography"> 
     125 
     126<xsl:value-of select="$project"/> - Publications - Papers by years 
     127================================================================== 
     128 
     129.. _top: 
     130 
     131This page intents to provide an exhaustive list of the papers that have used 
     132<xsl:value-of select="$project"/> and/or results from them. 
     133Obvioulsy many papers are missing. 
     134If you find omissions or mistakes please ask some modification via 
     135:ref:`main` 
     136 
     137You can also see **<xsl:value-of select="$project"/> - Publications - Papers** sorted by 
     138authors in :ref:`superbib02` 
     139or in :ref:`superbib01many` several 
     140one by author) 
     141 
     142<xsl:call-template name="para_lastupdate_bib"> 
     143 <xsl:with-param name="language" select="@xml:lang"/> 
     144 <xsl:with-param name="date" select="d:info/d:date"/> 
     145</xsl:call-template> 
     146 
     147<xsl:call-template name="years"/> 
     148 
     149.. _fig_pubbyyears: 
     150 
     151.. figure:: ../../images/years.png 
     152   :alt:[years.png] 
     153 
     154   Nb of publications by years 
     155 
     156.. _intro: 
     157 
     158Introduction 
     159============ 
     160 
     161This document provide bibliography sorted by year. 
     162 
     163   <!-- loop on years --> 
     164   <xsl:for-each select="$list_years"> 
     165    <xsl:sort order="descending" data-type="number" select="."/> 
     166    <xsl:call-template name="one_year"> 
     167     <xsl:with-param name="year" select="."/> 
     168    </xsl:call-template> 
     169   </xsl:for-each> 
     170</xsl:template> 
     171 
     172<xsl:template match="d:info/d:date"/> 
     173<xsl:template match="d:bibliography/d:title"/> 
     174 
     175<xsl:template name="one_year"> 
     176<xsl:param name="year"/> 
     177<!-- 
     178 <xsl:message>call template avec <xsl:value-of select="$year"/></xsl:message> 
     179 <xsl:message>noeud courant <xsl:value-of select="name(.)"/></xsl:message> 
     180 <xsl:message> 
     181year_<xsl:value-of select="$year"/> : <xsl:value-of select="count(/descendant::d:biblioentry[child::d:biblioset[child::d:pubdate=$year]]) + count(/descendant::d:biblioentry[child::d:date=$year])"/> 
     182</xsl:message> 
     183--> 
     184 
     185.. _<xsl:value-of select="concat('year_',$year)"/>: 
     186 
     187<xsl:value-of select="$year"/> 
     188========= 
     189 
     190 
     191   <xsl:for-each select="/descendant::d:biblioentry[child::d:biblioset[child::d:pubdate=$year]]|/descendant::d:biblioentry[child::d:date=$year]"> 
     192    <xsl:sort order="ascending" data-type="text" select="translate(./authorgroup/author/personname,'abcdefghijklmnopqrstuvwxyz éèçàùëöñó','ABCDEFGHIJKLMNOPQRSTUVWXYZ_EECAUEONO')"/> 
     193    <xsl:text>&#xA;</xsl:text> 
     194    <xsl:text>- </xsl:text> 
     195    <xsl:call-template name="one_biblioentry_rest"> 
     196     <xsl:with-param name="visu_modif" select="'visu'"/> 
     197     <xsl:with-param name="type" select="'raw'"/> 
     198     <xsl:with-param name="my_biblioentry" select="."/> 
     199    </xsl:call-template> 
     200    <xsl:text>&#xA;</xsl:text> 
     201   </xsl:for-each> 
     202</xsl:template> 
     203 
    74204</xsl:stylesheet> 
  • trunk/user_rest.xsl

    r116 r151  
    3131 
    3232--> 
    33  
    34 <xsl:import href="db_rest.xsl"/> 
    3533 
    3634<xsl:output method="text"/> 
Note: See TracChangeset for help on using the changeset viewer.