source: trunk/superbib01_xml.xsl @ 55

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

migration to docbook5 except biblio.xml; improvement of makefile

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