source: trunk/superbib01_xml.xsl @ 65

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

several bug fixes, improvement for conferences (but not complety ok), introducing test in makefile

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