source: trunk/superbib01_xml.xsl @ 57

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

start to introduce language dependency

  • 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<xsl:include href="message_lang.xsl"/>
43
44<xsl:variable name="list_years" select="///d:pubdate[not( self::node() = following::d:pubdate )]"/>
45
46<xsl:template name="years">
47<!--
48creation of an informatable of nb years
49each entry of the table is a link #year_xxxx
50-->
51<xsl:element name="informaltable">
52 <xsl:attribute name="xml:id">years</xsl:attribute>
53 <xsl:attribute name="summary">years of publications</xsl:attribute>
54 <xsl:element name="tgroup">
55  <xsl:variable name="nb_cols" select="count($list_years)"/>
56  <xsl:attribute name="cols"><xsl:value-of select="$nb_cols"/></xsl:attribute>
57  <xsl:attribute name="align">center</xsl:attribute>
58  <xsl:attribute name="colsep">1</xsl:attribute>
59  <xsl:attribute name="rowsep">1</xsl:attribute>
60  <xsl:for-each select="///d:pubdate[not( self::node() = following::d:pubdate )]">
61   <xsl:sort order="descending" data-type="number" select="."/>
62   <xsl:element name="colspec">
63    <xsl:attribute name="colname">year_<xsl:value-of select="."/></xsl:attribute>
64   </xsl:element>
65  </xsl:for-each>
66  <xsl:element name="tbody">
67   <xsl:element name="row">
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="entry">
71      <xsl:attribute name="colname"><xsl:text>year_</xsl:text><xsl:value-of select="."/></xsl:attribute>
72      <xsl:element name="link">
73       <xsl:attribute name="xl:href"><xsl:text>#year_</xsl:text><xsl:value-of select="."/></xsl:attribute>
74       <xsl:value-of select="."/>
75      </xsl:element>
76     </xsl:element>
77    </xsl:for-each>
78   </xsl:element>
79   <xsl:element name="row">
80    <xsl:for-each select="///d:pubdate[not( self::node() = following::d:pubdate )]">
81     <xsl:sort order="descending" data-type="number" select="."/>
82     <xsl:element name="entry">
83      <xsl:attribute name="colname"><xsl:text>year_</xsl:text><xsl:value-of select="."/></xsl:attribute>
84      <xsl:element name="emphasis">
85       <xsl:attribute name="role">bold</xsl:attribute>
86<xsl:variable name="nb_current">
87 <xsl:variable name="current_year"><xsl:value-of select="."/></xsl:variable>
88 <xsl:value-of select="count(/descendant::d:biblioentry[child::d:biblioset[child::d:pubdate=$current_year]])"/>
89</xsl:variable>
90       <xsl:value-of select="$nb_current"/>
91      </xsl:element>
92     </xsl:element>
93    </xsl:for-each>
94   </xsl:element>
95   <xsl:variable name="year_min">
96    <xsl:value-of select="///d:pubdate[not(. &gt; ///d:pubdate)]"/>
97   </xsl:variable>
98   <xsl:variable name="year_max">
99    <xsl:value-of select="///d:pubdate[not(. &lt; ///d:pubdate)]"/>
100   </xsl:variable>
101   <xsl:element name="row">
102    <xsl:element name="entry">
103     <xsl:attribute name="namest"><xsl:value-of select="concat('year_',$year_max)"/></xsl:attribute>
104      <xsl:attribute name="nameend"><xsl:value-of select="concat('year_',$year_min)"/></xsl:attribute>
105     <xsl:element name="emphasis">
106      <xsl:attribute name="role">bold</xsl:attribute>
107       <xsl:value-of select="count(/descendant::d:biblioentry)"/>
108     </xsl:element>
109    </xsl:element>
110   </xsl:element>
111  </xsl:element>
112 </xsl:element>
113</xsl:element>
114</xsl:template>
115
116<xsl:template match="d:bibliography">
117
118<xsl:element name="article">
119<xsl:attribute name="version">5.0</xsl:attribute>
120<xsl:attribute name="xmlns">http://docbook.org/ns/docbook</xsl:attribute>
121<xsl:attribute name="xml:lang"><xsl:value-of select="@xml:lang"/></xsl:attribute>
122<title>NEMO - Publications - Papers by years</title>
123<info>
124<authorgroup>
125<author><personname><firstname>Sébastien</firstname> <surname>Masson</surname></personname></author>
126<author><personname><firstname>Françoise</firstname> <surname>Pinsard</surname></personname></author>
127<!--++-->
128</authorgroup>
129<keywordset>
130<keyword>NEMO</keyword>
131</keywordset>
132<!-- ++ date -->
133</info>
134<para xml:id="top">
135This page intents to provide an exhaustive list of the papers that have used
136NEMO or OPA and/or results from them.
137Obvioulsy many papers are missing.
138If you find omissions or mistakes please ask some modification via
139<xsl:element name="link">
140 <xsl:attribute name="xl:href">
141  <xsl:value-of select="'./main.php'"/>
142 </xsl:attribute>
143 <xsl:text>Nemo Survey main page</xsl:text>
144</xsl:element>.
145</para>
146<para>
147You can also see <quote>NEMO - Publications - Papers</quote> sorted by
148authors in
149<xsl:element name="link">
150 <xsl:attribute name="xl:href">
151  <xsl:value-of select="'./superbib02.html'"/>
152 </xsl:attribute>
153 <xsl:text>one big document </xsl:text>
154</xsl:element>
155<xsl:text> or in </xsl:text>
156<xsl:element name="link">
157 <xsl:attribute name="xl:href">
158  <xsl:value-of select="'../many/superbib01/index.html'"/>
159 </xsl:attribute>
160 <xsl:text>several </xsl:text>
161</xsl:element> <xsl:text> (one by author)</xsl:text>.
162</para>
163
164<xsl:call-template name="para_lastupdate_bib">
165 <xsl:with-param name="language" select="@xml:lang"/>
166 <xsl:with-param name="date" select="d:info/d:date"/>
167</xsl:call-template>
168
169<xsl:call-template name="years"/>
170
171<figure xml:id="fig_pubbyyears"><title>Nb of publications by years</title>
172<mediaobject>
173<imageobject>
174<imagedata fileref="../../images/years.png" format="PNG"/>
175</imageobject>
176<textobject><phrase>[years.png]</phrase></textobject>
177</mediaobject>
178</figure>
179
180<sect1 xml:id="intro">
181<title>Introduction</title>
182<para>
183This document provide bibliography sorted by year.
184</para>
185</sect1>
186
187   <!-- loop on years -->
188   <xsl:for-each select="$list_years">
189    <xsl:sort order="descending" data-type="number" select="."/>
190    <xsl:call-template name="one_year">
191     <xsl:with-param name="year" select="."/>
192    </xsl:call-template>
193   </xsl:for-each>
194</xsl:element>
195</xsl:template>
196
197<xsl:template match="d:info/d:date"/>
198<xsl:template match="d:bibliography/d:title"/>
199
200<xsl:template name="one_year">
201<xsl:param name="year"/>
202<!--
203 <xsl:message>call template avec <xsl:value-of select="$year"/></xsl:message>
204 <xsl:message>noeud courant <xsl:value-of select="name(.)"/></xsl:message>
205 <xsl:message>
206year_<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])"/>
207</xsl:message>
208-->
209 <xsl:element name="sect1">
210  <xsl:attribute name="xml:id"><xsl:value-of select="concat('year_',$year)"/></xsl:attribute>
211  <xsl:element name="title">
212   <xsl:value-of select="$year"/>
213   <xsl:element name="link">
214   <xsl:attribute name="xl:href"><xsl:text>#top</xsl:text></xsl:attribute>
215   <xsl:element name="inlinemediaobject">
216     <xsl:element name="imageobject">
217      <xsl:element name="imagedata">
218       <xsl:attribute name="fileref">../../images/globalicondl11x10_up.gif</xsl:attribute>
219      </xsl:element>
220     </xsl:element>
221     <xsl:element name="textobject">
222      <xsl:element name="phrase">
223       <xsl:text>top</xsl:text>
224      </xsl:element>
225     </xsl:element>
226    </xsl:element>
227   </xsl:element>
228  </xsl:element>
229  <orderedlist>
230   <xsl:for-each select="/descendant::d:biblioentry[child::d:biblioset[child::d:pubdate=$year]]|/descendant::d:biblioentry[child::d:date=$year]">
231    <xsl:sort order="ascending" data-type="text" select="translate(./authorgroup/author/personname,'abcdefghijklmnopqrstuvwxyz éèçàùëöñó','ABCDEFGHIJKLMNOPQRSTUVWXYZ_EECAUEONO')"/>
232    <xsl:call-template name="one_biblioentry">
233     <xsl:with-param name="visu_modif" select="'visu'"/>
234     <xsl:with-param name="my_biblioentry" select="."/>
235    </xsl:call-template>
236   </xsl:for-each>
237  </orderedlist>
238 </xsl:element>
239</xsl:template>
240
241</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.