source: trunk/superbib01_xml.xsl @ 77

Last change on this file since 77 was 77, checked in by pinsard, 16 years ago

final touch for NEMO survey main page

  • Property svn:keywords set to Id
File size: 9.3 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
10NAME
11====
12
13produce a DocBook 5 with bibliograhy references sorted by years
14
15EVOLUTIONS
16==========
17
18$Id$
19
20- fplod 2008-09-17T10:40:43Z aedon.locean-ipsl.upmc.fr (Darwin)
21
22  * project name from main.xml file instead of a fixed one
23
24- fplod 2008-04-30T10:32:48Z aedon.locean-ipsl.upmc.fr (Darwin)
25
26  * language inherited from biblio.xml
27
28- fplod 2008-04-29T15:23:51Z aedon.locean-ipsl.upmc.fr (Darwin)
29
30  * chgt for dbk5 in ++
31
32- fplod 2008-04-29T07:46:20Z aedon.locean-ipsl.upmc.fr (Darwin)
33
34  * chgt for dbk5 out
35
36- fplod 2007-10-17T08:01:14Z aedon.locean-ipsl.upmc.fr (Darwin)
37
38  * improve authors sort (diacriticals)
39
40- fplod 2007-06-08T08:36:48Z aedon.locean-ipsl.upmc.fr (Darwin)
41
42  * add total nb of publications in one cell. quite interesting usage of
43    XPATH to determine mininum and maximum value of a element !
44
45- fplod 2007-05-21T14:06:53Z aedon.locean-ipsl.upmc.fr (Darwin)
46
47  * ajout de plot nbpub/years
48
49- fplod 2007-05-04T08:02:29Z aedon.locean-ipsl.upmc.fr (Darwin)
50
51  * externalisation de biblioentry
52  * passage de itemizedlist à sect1 pour homogénéisation sur présentation par auteur(et parce que je préfère)
53
54- fplod 2007-04-02T08:53:30Z aedon.locean-ipsl.upmc.fr (Darwin)
55
56  * journal dans biblioset
57
58- fplod 2007-03-30T12:38:34Z aedon.locean-ipsl.upmc.fr (Darwin)
59
60  * creation
61
62-->
63
64<xsl:output
65 method="xml"
66 indent="yes"
67 omit-xml-declaration="no"/>
68
69<xsl:include href="biblioentry_xml.xsl"/>
70
71<xsl:variable name="list_years" select="///d:pubdate[not( self::node() = following::d:pubdate )]"/>
72
73<xsl:variable name="project">
74 <xsl:value-of select="document('main.xml')//d:keyword[@xml:id='project']"/>
75</xsl:variable>
76
77<xsl:template name="years">
78<!--
79creation of an informatable of nb years
80each entry of the table is a link #year_xxxx
81-->
82<xsl:element name="informaltable">
83 <xsl:attribute name="xml:id">years</xsl:attribute>
84 <xsl:attribute name="summary">years of publications</xsl:attribute>
85 <xsl:element name="tgroup">
86  <xsl:variable name="nb_cols" select="count($list_years)"/>
87  <xsl:attribute name="cols"><xsl:value-of select="$nb_cols"/></xsl:attribute>
88  <xsl:attribute name="align">center</xsl:attribute>
89  <xsl:attribute name="colsep">1</xsl:attribute>
90  <xsl:attribute name="rowsep">1</xsl:attribute>
91  <xsl:for-each select="///d:pubdate[not( self::node() = following::d:pubdate )]">
92   <xsl:sort order="descending" data-type="number" select="."/>
93   <xsl:element name="colspec">
94    <xsl:attribute name="colname">year_<xsl:value-of select="."/></xsl:attribute>
95   </xsl:element>
96  </xsl:for-each>
97  <xsl:element name="tbody">
98   <xsl:element name="row">
99    <xsl:for-each select="///d:pubdate[not( self::node() = following::d:pubdate )]">
100     <xsl:sort order="descending" data-type="number" select="."/>
101     <xsl:element name="entry">
102      <xsl:attribute name="colname"><xsl:text>year_</xsl:text><xsl:value-of select="."/></xsl:attribute>
103      <xsl:element name="link">
104       <xsl:attribute name="xl:href"><xsl:text>#year_</xsl:text><xsl:value-of select="."/></xsl:attribute>
105       <xsl:value-of select="."/>
106      </xsl:element>
107     </xsl:element>
108    </xsl:for-each>
109   </xsl:element>
110   <xsl:element name="row">
111    <xsl:for-each select="///d:pubdate[not( self::node() = following::d:pubdate )]">
112     <xsl:sort order="descending" data-type="number" select="."/>
113     <xsl:element name="entry">
114      <xsl:attribute name="colname"><xsl:text>year_</xsl:text><xsl:value-of select="."/></xsl:attribute>
115      <xsl:element name="emphasis">
116       <xsl:attribute name="role">bold</xsl:attribute>
117<xsl:variable name="nb_current">
118 <xsl:variable name="current_year"><xsl:value-of select="."/></xsl:variable>
119 <xsl:value-of select="count(/descendant::d:biblioentry[child::d:biblioset[child::d:pubdate=$current_year]])"/>
120</xsl:variable>
121       <xsl:value-of select="$nb_current"/>
122      </xsl:element>
123     </xsl:element>
124    </xsl:for-each>
125   </xsl:element>
126   <xsl:variable name="year_min">
127    <xsl:value-of select="///d:pubdate[not(. &gt; ///d:pubdate)]"/>
128   </xsl:variable>
129   <xsl:variable name="year_max">
130    <xsl:value-of select="///d:pubdate[not(. &lt; ///d:pubdate)]"/>
131   </xsl:variable>
132   <xsl:element name="row">
133    <xsl:element name="entry">
134     <xsl:attribute name="namest"><xsl:value-of select="concat('year_',$year_max)"/></xsl:attribute>
135      <xsl:attribute name="nameend"><xsl:value-of select="concat('year_',$year_min)"/></xsl:attribute>
136     <xsl:element name="emphasis">
137      <xsl:attribute name="role">bold</xsl:attribute>
138       <xsl:value-of select="count(/descendant::d:biblioentry)"/>
139     </xsl:element>
140    </xsl:element>
141   </xsl:element>
142  </xsl:element>
143 </xsl:element>
144</xsl:element>
145</xsl:template>
146
147<xsl:template match="d:bibliography">
148
149<xsl:element name="article">
150<xsl:attribute name="version">5.0</xsl:attribute>
151<xsl:attribute name="xmlns">http://docbook.org/ns/docbook</xsl:attribute>
152<xsl:attribute name="xml:lang"><xsl:value-of select="@xml:lang"/></xsl:attribute>
153<title><xsl:value-of select="$project"/> - Publications - Papers by years</title>
154<info>
155<authorgroup>
156<author><personname><firstname>Sébastien</firstname> <surname>Masson</surname></personname></author>
157<author><personname><firstname>Françoise</firstname> <surname>Pinsard</surname></personname></author>
158<!--++-->
159</authorgroup>
160<keywordset>
161<keyword><xsl:value-of select="$project"/></keyword>
162</keywordset>
163<!-- ++ date -->
164</info>
165<para xml:id="top">
166This page intents to provide an exhaustive list of the papers that have used
167<xsl:value-of select="$project"/> and/or results from them.
168Obvioulsy many papers are missing.
169If you find omissions or mistakes please ask some modification via
170<xsl:element name="link">
171 <xsl:attribute name="xl:href">
172  <xsl:value-of select="'./main.php'"/>
173 </xsl:attribute>
174 <xsl:value-of select="document('main.xml')/d:article/d:title"/>
175 <xsl:text> main page</xsl:text>
176</xsl:element>.
177</para>
178<para>
179You can also see <quote><xsl:value-of select="$project"/> - Publications - Papers</quote> sorted by
180authors in
181<xsl:element name="link">
182 <xsl:attribute name="xl:href">
183  <xsl:value-of select="'./superbib02.html'"/>
184 </xsl:attribute>
185 <xsl:text>one big document </xsl:text>
186</xsl:element>
187<xsl:text> or in </xsl:text>
188<xsl:element name="link">
189 <xsl:attribute name="xl:href">
190  <xsl:value-of select="'../many/superbib01/index.html'"/>
191 </xsl:attribute>
192 <xsl:text>several </xsl:text>
193</xsl:element> <xsl:text> (one by author)</xsl:text>.
194</para>
195
196<xsl:call-template name="para_lastupdate_bib">
197 <xsl:with-param name="language" select="@xml:lang"/>
198 <xsl:with-param name="date" select="d:info/d:date"/>
199</xsl:call-template>
200
201<xsl:call-template name="years"/>
202
203<figure xml:id="fig_pubbyyears"><title>Nb of publications by years</title>
204<mediaobject>
205<imageobject>
206<imagedata fileref="../../images/years.png" format="PNG"/>
207</imageobject>
208<textobject><phrase>[years.png]</phrase></textobject>
209</mediaobject>
210</figure>
211
212<sect1 xml:id="intro">
213<title>Introduction</title>
214<para>
215This document provide bibliography sorted by year.
216</para>
217</sect1>
218
219   <!-- loop on years -->
220   <xsl:for-each select="$list_years">
221    <xsl:sort order="descending" data-type="number" select="."/>
222    <xsl:call-template name="one_year">
223     <xsl:with-param name="year" select="."/>
224    </xsl:call-template>
225   </xsl:for-each>
226</xsl:element>
227</xsl:template>
228
229<xsl:template match="d:info/d:date"/>
230<xsl:template match="d:bibliography/d:title"/>
231
232<xsl:template name="one_year">
233<xsl:param name="year"/>
234<!--
235 <xsl:message>call template avec <xsl:value-of select="$year"/></xsl:message>
236 <xsl:message>noeud courant <xsl:value-of select="name(.)"/></xsl:message>
237 <xsl:message>
238year_<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])"/>
239</xsl:message>
240-->
241 <xsl:element name="sect1">
242  <xsl:attribute name="xml:id"><xsl:value-of select="concat('year_',$year)"/></xsl:attribute>
243  <xsl:element name="title">
244   <xsl:value-of select="$year"/>
245   <xsl:element name="link">
246   <xsl:attribute name="xl:href"><xsl:text>#top</xsl:text></xsl:attribute>
247   <xsl:element name="inlinemediaobject">
248     <xsl:element name="imageobject">
249      <xsl:element name="imagedata">
250       <xsl:attribute name="fileref">../../images/globalicondl11x10_up.gif</xsl:attribute>
251      </xsl:element>
252     </xsl:element>
253     <xsl:element name="textobject">
254      <xsl:element name="phrase">
255       <xsl:text>top</xsl:text>
256      </xsl:element>
257     </xsl:element>
258    </xsl:element>
259   </xsl:element>
260  </xsl:element>
261  <orderedlist>
262   <xsl:for-each select="/descendant::d:biblioentry[child::d:biblioset[child::d:pubdate=$year]]|/descendant::d:biblioentry[child::d:date=$year]">
263    <xsl:sort order="ascending" data-type="text" select="translate(./authorgroup/author/personname,'abcdefghijklmnopqrstuvwxyz éèçàùëöñó','ABCDEFGHIJKLMNOPQRSTUVWXYZ_EECAUEONO')"/>
264    <xsl:call-template name="one_biblioentry">
265     <xsl:with-param name="visu_modif" select="'visu'"/>
266     <xsl:with-param name="type" select="'raw'"/>
267     <xsl:with-param name="my_biblioentry" select="."/>
268    </xsl:call-template>
269   </xsl:for-each>
270  </orderedlist>
271 </xsl:element>
272</xsl:template>
273
274</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.