source: trunk/superbib01_rest.xsl

Last change on this file was 355, checked in by pinsard, 10 years ago

fix thanks to coding rules; typo; dupe empty lines

  • Property svn:keywords set to Id
File size: 6.5 KB
Line 
1<?xml version="1.0" encoding="iso-8859-1"?>
2<xsl:stylesheet
3version="1.0"
4xmlns:d="http://docbook.org/ns/docbook"
5xmlns:xl="http://www.w3.org/1999/xlink"
6xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
7
8<!--rst
9
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`
22
23TODO
24====
25
26link sur top chaque section
27:ref:`top` ../../images/globalicondl11x10_up.gif
28
29tableau d'années
30
31EVOLUTIONS
32==========
33
34$Id$
35
36- fplod 2001228
37
38  * recreation
39
40-->
41
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">
55<!--
56creation of an informatable of nb years
57each entry of the table is a link #year_xxxx
58-->
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>
119  </xsl:element>
120 </xsl:element>
121</xsl:element>
122</xsl:template>
123
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:with-param name="mode" select="'rest'"/>
146</xsl:call-template>
147
148<xsl:call-template name="years"/>
149
150.. _fig_pubbyyears:
151
152.. figure:: ../../images/years.png
153   :alt:[years.png]
154
155   Nb of publications by years
156
157.. _intro:
158
159Introduction
160============
161
162This document provide bibliography sorted by year.
163
164   <!-- loop on years -->
165   <xsl:for-each select="$list_years">
166    <xsl:sort order="descending" data-type="number" select="."/>
167    <xsl:call-template name="one_year">
168     <xsl:with-param name="year" select="."/>
169    </xsl:call-template>
170   </xsl:for-each>
171</xsl:template>
172
173<xsl:template match="d:info/d:date"/>
174<xsl:template match="d:bibliography/d:title"/>
175
176<xsl:template name="one_year">
177<xsl:param name="year"/>
178<!--
179 <xsl:message>call template avec <xsl:value-of select="$year"/></xsl:message>
180 <xsl:message>noeud courant <xsl:value-of select="name(.)"/></xsl:message>
181 <xsl:message>
182year_<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])"/>
183</xsl:message>
184-->
185
186.. _<xsl:value-of select="concat('year_',$year)"/>:
187
188<xsl:value-of select="$year"/>
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
204</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.