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