source: trunk/biblioentry_xml.xsl

Last change on this file was 355, checked in by pinsard, 10 years ago

fix thanks to coding rules; typo; dupe empty lines

  • Property svn:keywords set to Id
File size: 24.9 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:html="http://www.w3.org/1999/xhtml"
7xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
8
9<!--rst
10
11.. _biblioentry_xml.xsl:
12
13===================
14biblioentry_xml.xsl
15===================
16
17DESCRIPTION
18===========
19
20traitement d'une référence bibliographique (biblioentry)
21
22EVOLUTIONS
23==========
24
25$Id$
26
27- fplod 2008-05-15T09:18:54Z aedon.locean-ipsl.upmc.fr (Darwin)
28
29  * correction on separators between authors for bibtex
30
31- fplod 2008-05-14T08:51:10Z aedon.locean-ipsl.upmc.fr (Darwin)
32
33  * introducting bibtex (latex) output
34
35- fplod 2008-05-13T15:24:49Z aedon.locean-ipsl.upmc.fr (Darwin)
36
37  * add parameter type (default raw)
38
39- fplod 2008-05-13T09:17:14Z aedon.locean-ipsl.upmc.fr (Darwin)
40
41  * bibliomisc is written after biblioid
42
43- fplod 2008-05-07T09:06:53Z aedon.locean-ipsl.upmc.fr (Darwin)
44
45  * improvements for conference
46
47- fplod 2008-05-06T09:35:00Z aedon.locean-ipsl.upmc.fr (Darwin)
48
49  * add category choices
50
51- fplod 2008-04-29T15:41:56Z aedon.locean-ipsl.upmc.fr (Darwin)
52
53  * chgt for dbk5 in
54
55- fplod 2008-04-29T09:10:31Z aedon.locean-ipsl.upmc.fr (Darwin)
56
57  * chgt for dbk5 out
58
59- fplod 2007-06-20T17:18:02Z aedon.locean-ipsl.upmc.fr (Darwin)
60
61  * <bibliomisc role="id"> replaced by <biblioid class="doi">
62
63- fplod 2007-05-16T14:01:44Z aedon.locean-ipsl.upmc.fr (Darwin)
64
65  * correction in order to write doi only once
66
67- fplod 2007-05-16T10:27:34Z aedon.locean-ipsl.upmc.fr (Darwin)
68
69  * remove biblioentry/date and publisher
70  * add biblioentry/biblioset/bibliomisc
71
72- fplod 2007-05-15T07:37:46Z aedon.locean-ipsl.upmc.fr (Darwin)
73
74  * factorisation de biblioentry
75
76- fplod 2007-05-14T15:48:04Z aedon.locean-ipsl.upmc.fr (Darwin)
77
78  * correction to add biblioentry/date (replace biblioentry/biblioset/pubdate)
79    when "in press"
80
81- fplod 2007-05-04T07:59:34Z aedon.locean-ipsl.upmc.fr (Darwin)
82
83  * factorisation de bibnemomaf01_xml.xsl, bibnemomaf02_xml.xsl,bibnemomaf04_xml.xsl
84
85-->
86
87<xsl:include href="correction_db.xsl"/>
88<xsl:include href="category_form.xsl"/>
89<xsl:include href="message_lang.xsl"/>
90
91<xsl:template name="one_biblioentry">
92 <xsl:param name="visu_modif"/>
93 <xsl:param name="type"/>
94 <xsl:param name="my_biblioentry"/>
95 <xsl:choose>
96  <xsl:when test="$type = 'bibtex'">
97   <xsl:choose>
98    <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='journal']">
99     <xsl:text>@article{</xsl:text>
100    </xsl:when>
101    <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='conference']">
102     <xsl:text>@inproceedings{</xsl:text>
103    </xsl:when>
104    <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='book']">
105     <xsl:text>@book{</xsl:text>
106    </xsl:when>
107    <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='manual']">
108     <xsl:text>@manual{</xsl:text>
109    </xsl:when>
110    <xsl:otherwise>
111     <xsl:message terminate="yes">
112eee : unknown biblioset 1 relation for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
113eee : <xsl:value-of select="$my_biblioentry/descendant::d:biblioset/@relation"/>
114     </xsl:message>
115    </xsl:otherwise>
116   </xsl:choose>
117   <xsl:value-of select="$my_biblioentry/@xml:id"/>
118  </xsl:when> <!-- end of bibtex specific header for biblioentry -->
119 </xsl:choose>
120 <xsl:element name="listitem">
121  <xsl:element name="para">
122   <xsl:choose>
123    <xsl:when test="$type = 'bibtex'">
124     <xsl:apply-templates select="$my_biblioentry/d:authorgroup" mode="bibtex"/>
125    </xsl:when>
126    <xsl:otherwise>
127     <xsl:apply-templates select="$my_biblioentry/d:authorgroup" mode="raw"/>
128    </xsl:otherwise>
129   </xsl:choose>
130   <xsl:if test="$my_biblioentry/descendant::d:pubdate">
131    <xsl:choose>
132     <xsl:when test="$type = 'bibtex'">
133      <xsl:apply-templates select="$my_biblioentry/descendant::d:pubdate" mode="bibtex"/>
134     </xsl:when>
135     <xsl:otherwise>
136      <xsl:apply-templates select="$my_biblioentry/descendant::d:pubdate" mode="raw"/>
137     </xsl:otherwise>
138    </xsl:choose>
139   </xsl:if>
140    <xsl:if test="$my_biblioentry/descendant::d:date">
141     <xsl:apply-templates select="$my_biblioentry/descendant::d:date"/>
142    </xsl:if>
143   <xsl:choose>
144    <xsl:when test="$type = 'bibtex'">
145     <xsl:apply-templates select="$my_biblioentry/d:title" mode="bibtex"/>
146    </xsl:when>
147    <xsl:otherwise>
148     <xsl:apply-templates select="$my_biblioentry/d:title" mode="raw"/>
149    </xsl:otherwise>
150   </xsl:choose>
151    <xsl:choose>
152     <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='journal']">
153      <xsl:choose>
154       <xsl:when test="$type = 'bibtex'">
155        <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:title" mode="bibtex"/>
156       </xsl:when>
157       <xsl:otherwise>
158        <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:title" mode="raw"/>
159       </xsl:otherwise>
160      </xsl:choose>
161      <xsl:if test="$my_biblioentry/descendant::d:publishername">
162       <xsl:choose>
163        <xsl:when test="$type = 'bibtex'">
164         <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:publishername" mode="bibtex"/>
165        </xsl:when>
166        <xsl:otherwise>
167         <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:publishername" mode="raw"/>
168        </xsl:otherwise>
169       </xsl:choose>
170      </xsl:if>
171      <xsl:if test="$my_biblioentry/descendant::d:publisher/d:address">
172       <xsl:choose>
173        <xsl:when test="$type = 'bibtex'">
174         <xsl:apply-templates select="$my_biblioentry/descendant::d:publisher/d:address" mode="bibtex"/>
175        </xsl:when>
176        <xsl:otherwise>
177         <xsl:apply-templates select="$my_biblioentry/descendant::d:publisher/d:address" mode="raw"/>
178        </xsl:otherwise>
179       </xsl:choose>
180      </xsl:if>
181      <xsl:if test="$my_biblioentry/descendant::d:volumenum">
182       <xsl:choose>
183        <xsl:when test="$type = 'bibtex'">
184         <xsl:apply-templates select="$my_biblioentry/descendant::d:volumenum" mode="bibtex"/>
185        </xsl:when>
186        <xsl:otherwise>
187         <xsl:apply-templates select="$my_biblioentry/descendant::d:volumenum" mode="raw"/>
188        </xsl:otherwise>
189       </xsl:choose>
190       <xsl:if test="$my_biblioentry/descendant::d:issuenum">
191        <xsl:choose>
192         <xsl:when test="$type = 'bibtex'">
193          <xsl:apply-templates select="$my_biblioentry/descendant::d:issuenum" mode="bibtex"/>
194         </xsl:when>
195         <xsl:otherwise>
196          <xsl:apply-templates select="$my_biblioentry/descendant::d:issuenum" mode="raw"/>
197         </xsl:otherwise>
198        </xsl:choose>
199        </xsl:if>
200       </xsl:if>
201      <xsl:if test="$my_biblioentry/descendant::d:pagenums">
202       <xsl:choose>
203        <xsl:when test="$type = 'bibtex'">
204         <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums" mode="bibtex"/>
205        </xsl:when>
206        <xsl:otherwise>
207         <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums" mode="raw"/>
208        </xsl:otherwise>
209       </xsl:choose>
210      </xsl:if>
211      <xsl:if test="$my_biblioentry/d:biblioid">
212       <xsl:choose>
213        <xsl:when test="$type = 'bibtex'">
214         <xsl:apply-templates select="$my_biblioentry/d:biblioid" mode="bibtex"/>
215        </xsl:when>
216        <xsl:otherwise>
217        <xsl:apply-templates select="$my_biblioentry/d:biblioid" mode="raw"/>
218        </xsl:otherwise>
219       </xsl:choose>
220      </xsl:if>
221      <xsl:if test="$my_biblioentry/descendant::d:biblioset/child::d:bibliomisc">
222       <xsl:choose>
223        <xsl:when test="$type = 'bibtex'">
224         <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:bibliomisc" mode="bibtex"/>
225        </xsl:when>
226        <xsl:otherwise>
227        <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:bibliomisc" mode="raw"/>
228        </xsl:otherwise>
229       </xsl:choose>
230      </xsl:if>
231     </xsl:when>
232     <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='conference']">
233      <xsl:choose>
234       <xsl:when test="$type = 'bibtex'">
235        <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset[@relation='conference']/child::d:title" mode="bibtex"/>
236       </xsl:when>
237       <xsl:otherwise>
238        <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:title" mode="raw"/>
239       </xsl:otherwise>
240      </xsl:choose>
241      <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:conftitle"/>
242      <xsl:if test="$my_biblioentry/descendant::d:biblioset/descendant::d:confnum">
243       <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:confnum"/>
244      </xsl:if>
245      <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:confdates"/>
246       <xsl:choose>
247        <xsl:when test="$type = 'bibtex'">
248         <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:address" mode="bibtex"/>
249        </xsl:when>
250        <xsl:otherwise>
251         <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:address" mode="raw"/>
252        </xsl:otherwise>
253       </xsl:choose>
254       <xsl:choose>
255        <xsl:when test="$type = 'bibtex'">
256         <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername" mode="bibtex"/>
257        </xsl:when>
258        <xsl:otherwise>
259         <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername" mode="raw"/>
260        </xsl:otherwise>
261       </xsl:choose>
262      <xsl:if test="$my_biblioentry/descendant::d:pagenums">
263       <xsl:choose>
264        <xsl:when test="$type = 'bibtex'">
265         <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums" mode="bibtex"/>
266        </xsl:when>
267        <xsl:otherwise>
268         <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums" mode="raw"/>
269        </xsl:otherwise>
270       </xsl:choose>
271      </xsl:if>
272     </xsl:when>
273     <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='book']">
274      <xsl:choose>
275       <xsl:when test="$type = 'bibtex'">
276        <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset[@relation='book']/child::d:title" mode="bibtex"/>
277       </xsl:when>
278       <xsl:otherwise>
279        <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:title" mode="raw"/>
280       </xsl:otherwise>
281      </xsl:choose>
282       <xsl:choose>
283        <xsl:when test="$type = 'bibtex'">
284         <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername" mode="bibtex"/>
285        </xsl:when>
286        <xsl:otherwise>
287         <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername" mode="raw"/>
288        </xsl:otherwise>
289       </xsl:choose>
290      <xsl:if test="$my_biblioentry/descendant::d:pagenums">
291       <xsl:choose>
292        <xsl:when test="$type = 'bibtex'">
293         <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums" mode="bibtex"/>
294        </xsl:when>
295        <xsl:otherwise>
296         <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums" mode="raw"/>
297        </xsl:otherwise>
298       </xsl:choose>
299      </xsl:if>
300       <xsl:choose>
301        <xsl:when test="$type = 'bibtex'">
302         <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioid" mode="bibtex"/>
303        </xsl:when>
304        <xsl:otherwise>
305         <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioid" mode="raw"/>
306        </xsl:otherwise>
307       </xsl:choose>
308      </xsl:when>
309     <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='manual']">
310      <xsl:choose>
311       <xsl:when test="$type = 'bibtex'">
312        <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset[@relation='manual']/child::d:title" mode="bibtex"/>
313       </xsl:when>
314       <xsl:otherwise>
315        <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:title" mode="raw"/>
316       </xsl:otherwise>
317      </xsl:choose>
318       <xsl:choose>
319        <xsl:when test="$type = 'bibtex'">
320         <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername" mode="bibtex"/>
321        </xsl:when>
322        <xsl:otherwise>
323         <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername" mode="raw"/>
324        </xsl:otherwise>
325       </xsl:choose>
326       <xsl:choose>
327        <xsl:when test="$type = 'bibtex'">
328         <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioid" mode="bibtex"/>
329        </xsl:when>
330        <xsl:otherwise>
331         <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioid" mode="raw"/>
332        </xsl:otherwise>
333       </xsl:choose>
334     </xsl:when>
335     <xsl:otherwise>
336      <xsl:message terminate="no">
337eee : unknown biblioset 2 relation for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
338eee : <xsl:value-of select="$my_biblioentry/descendant::d:biblioset/@relation"/>
339      </xsl:message>
340       <xsl:choose>
341        <xsl:when test="$type = 'bibtex'">
342         <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername" mode="bibtex"/>
343        </xsl:when>
344        <xsl:otherwise>
345         <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername" mode="raw"/>
346        </xsl:otherwise>
347       </xsl:choose>
348     </xsl:otherwise>
349    </xsl:choose>
350  </xsl:element>
351  <xsl:if test="$visu_modif= 'modif'">
352   <xsl:call-template name="correction">
353    <xsl:with-param name="id" select="$my_biblioentry/@xml:id"/>
354   </xsl:call-template>
355  </xsl:if>
356  <xsl:if test="$visu_modif= 'category'">
357   <xsl:call-template name="category">
358    <xsl:with-param name="id" select="$my_biblioentry/@xml:id"/>
359   </xsl:call-template>
360  </xsl:if>
361 </xsl:element>
362 <xsl:choose>
363  <xsl:when test="$type = 'bibtex'">
364  <xsl:text>}</xsl:text>
365  </xsl:when>
366 </xsl:choose>
367</xsl:template>
368
369<xsl:template match="d:authorgroup" mode="raw">
370 <xsl:apply-templates select="d:author" mode="raw"/>
371 <xsl:apply-templates select="d:corpauthor" mode="raw"/>
372</xsl:template>
373
374<xsl:template match="d:authorgroup" mode="bibtex">
375 <xsl:text>, </xsl:text>
376 <xsl:text>author = {</xsl:text>
377 <xsl:apply-templates select="d:author" mode="bibtex"/>
378 <xsl:apply-templates select="d:corpauthor" mode="bibtex"/>
379 <xsl:text>}</xsl:text>
380</xsl:template>
381
382<xsl:template match="d:author|d:corpauthor" mode="raw">
383<!--
3841er auteur Nom, prénom les autres Prenom Nom
385une virgule entre les auteurs sauf entre les deux derniers
386-->
387  <xsl:if test="d:personname/d:surname = ''">
388   <xsl:message>
389eee : empty surname for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
390   </xsl:message>
391  </xsl:if>
392  <xsl:if test="d:personname/d:firstname= ''">
393   <xsl:message>
394eee : empty firstname for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
395   </xsl:message>
396  </xsl:if>
397  <xsl:if test="d:personname/d:firstname= '.'">
398   <xsl:message>
399eee : firstname = '.' for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
400   </xsl:message>
401  </xsl:if>
402<!--
403   <xsl:message>
404position de l'auteur <xsl:value-of select="d:personname/d:surname"/> :
405<xsl:value-of select="position()"/> / <xsl:value-of select="count(following-sibling::*)"/>
406</xsl:message>
407-->
408
409  <xsl:choose>
410   <xsl:when test="position()=1">
411    <xsl:value-of select="d:personname/d:surname"/><xsl:text>, </xsl:text>
412    <xsl:value-of select="d:personname/d:firstname"/>
413   </xsl:when>
414   <xsl:otherwise>
415    <xsl:value-of select="d:personname/d:firstname"/><xsl:text> </xsl:text>
416    <xsl:value-of select="d:personname/d:surname"/>
417   </xsl:otherwise>
418  </xsl:choose>
419
420<!--
421une virgule entre les auteurs sauf entre les deux derniers
422-->
423  <xsl:choose>
424   <xsl:when test="count(following-sibling::*)  &gt; 1"> <!-- plusieurs suivants -->
425    <xsl:text>, </xsl:text>
426   </xsl:when>
427   <xsl:when test="count(following-sibling::*)  = 1">
428<!--
429   <xsl:message>ANDDDDD</xsl:message>
430-->
431    <!-- un suivant -->
432    <xsl:call-template name="and">
433     <xsl:with-param name="language" select="/d:bibliography/@xml:lang"/>
434    </xsl:call-template>
435   </xsl:when>
436  </xsl:choose>
437</xsl:template>
438
439<xsl:template match="d:author|d:corpauthor" mode="bibtex">
440<!--
4411er auteur Nom prénom les autres Prenom Nom
442and entre les auteurs
443-->
444 <xsl:value-of select="d:personname/d:firstname"/><xsl:text> </xsl:text>
445 <xsl:value-of select="d:personname/d:surname"/>
446
447<!--
448and entre les auteurs
449-->
450  <xsl:choose>
451   <xsl:when test="count(following-sibling::*)  &gt; 0"> <!-- un suivant-->
452    <xsl:text> and </xsl:text>
453   </xsl:when>
454  </xsl:choose>
455</xsl:template>
456
457<xsl:template match="d:biblioentry/d:title" mode="raw">
458 <xsl:text> : </xsl:text>
459 <xsl:value-of select="normalize-space(.)"/>
460</xsl:template>
461
462<xsl:template match="d:biblioentry/d:title" mode="bibtex">
463 <xsl:text>, title = {</xsl:text>
464 <xsl:value-of select="normalize-space(.)"/>
465 <xsl:text>}</xsl:text>
466</xsl:template>
467
468<xsl:template match="d:biblioset[@relation='journal']/d:title" mode="raw">
469 <xsl:text>, </xsl:text>
470 <xsl:value-of select="normalize-space(.)"/>
471</xsl:template>
472
473<xsl:template match="d:biblioset[@relation='journal']/d:title" mode="bibtex">
474 <xsl:text>, journal = {</xsl:text>
475 <xsl:value-of select="normalize-space(.)"/>
476 <xsl:text>}</xsl:text>
477</xsl:template>
478
479<xsl:template match="d:biblioset[@relation='conference']/d:title" mode="raw">
480 <xsl:text>, </xsl:text>
481 <xsl:value-of select="normalize-space(.)"/>
482</xsl:template>
483
484<xsl:template match="d:biblioset[@relation='conference']/d:title" mode="bibtex">
485 <xsl:text>, booktitle = {</xsl:text>
486 <xsl:value-of select="normalize-space(.)"/>
487 <xsl:text>}</xsl:text>
488</xsl:template>
489
490<xsl:template match="d:publishername" mode="raw">
491 <xsl:text>, </xsl:text>
492 <xsl:value-of select="normalize-space(.)"/>
493</xsl:template>
494
495<xsl:template match="d:publishername" mode="bibtex">
496 <xsl:text>, publisher = {</xsl:text>
497 <xsl:value-of select="normalize-space(.)"/>
498 <xsl:text>}</xsl:text>
499</xsl:template>
500
501<xsl:template match="d:pubdate" mode="raw">
502 <xsl:text>, </xsl:text>
503 <xsl:value-of select="normalize-space(.)"/>
504</xsl:template>
505
506<xsl:template match="d:pubdate" mode="bibtex">
507 <xsl:text>, year = {</xsl:text>
508 <xsl:value-of select="normalize-space(.)"/>
509 <xsl:text>}</xsl:text>
510</xsl:template>
511
512<xsl:template match="d:date">
513 <xsl:message terminate="no">
514   eee : date
515   <xsl:value-of select="normalize-space(.)"/> exists in node
516   <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
517   eee : try to put information in biblioset
518 </xsl:message>
519</xsl:template>
520
521<xsl:template match="d:volumenum" mode="raw">
522 <xsl:text>, </xsl:text>
523 <xsl:value-of select="normalize-space(.)"/>
524</xsl:template>
525
526<xsl:template match="d:volumenum" mode="bibtex">
527 <xsl:text>, volume = {</xsl:text>
528 <xsl:value-of select="normalize-space(.)"/>
529 <xsl:text>}</xsl:text>
530</xsl:template>
531
532<xsl:template match="d:issuenum" mode="raw">
533 <xsl:text>, </xsl:text>
534 <xsl:value-of select="normalize-space(.)"/>
535</xsl:template>
536
537<xsl:template match="d:issuenum" mode="bibtex">
538 <xsl:text>, number = {</xsl:text>
539 <xsl:value-of select="normalize-space(.)"/>
540 <xsl:text>}</xsl:text>
541</xsl:template>
542
543<xsl:template match="d:pagenums" mode="raw">
544 <xsl:text>, </xsl:text>
545 <xsl:value-of select="normalize-space(.)"/>
546</xsl:template>
547
548<xsl:template match="d:pagenums" mode="bibtex">
549 <xsl:text>, pages = {</xsl:text>
550 <xsl:value-of select="normalize-space(.)"/>
551 <xsl:text>}</xsl:text>
552</xsl:template>
553
554<xsl:template match="d:biblioid[@class='isbn']" mode="raw">
555 <xsl:text>, ISBN : </xsl:text>
556 <xsl:value-of select="normalize-space(.)"/>
557</xsl:template>
558
559<xsl:template match="d:biblioid[@class='isbn']" mode="bibtex">
560 <xsl:text>, isbn = {</xsl:text>
561 <xsl:value-of select="normalize-space(.)"/>
562 <xsl:text>}</xsl:text>
563</xsl:template>
564
565<xsl:template match="d:biblioid[@class='uri']" mode="raw">
566 <xsl:text>, </xsl:text>
567 <xsl:element name="link">
568  <xsl:attribute name="xl:href"><xsl:value-of select="normalize-space(.)"/></xsl:attribute>
569 </xsl:element>
570</xsl:template>
571
572<xsl:template match="d:biblioid[@class='uri']" mode="bibtex">
573 <xsl:text>, uri = {</xsl:text>
574 <xsl:value-of select="normalize-space(.)"/>
575 <xsl:text>}</xsl:text>
576</xsl:template>
577
578<xsl:template match="d:biblioid[@class='other']" mode="raw">
579 <xsl:text>, </xsl:text>
580 <xsl:value-of select="@otherclass"/>
581 <xsl:text> : </xsl:text>
582 <xsl:value-of select="normalize-space(.)"/>
583</xsl:template>
584
585<xsl:template match="d:biblioid[@class='other']" mode="bibtex">
586 <xsl:text>, note = {</xsl:text>
587 <xsl:value-of select="@otherclass"/>
588 <xsl:text> : </xsl:text>
589 <xsl:value-of select="normalize-space(.)"/>
590 <xsl:text>}</xsl:text>
591</xsl:template>
592
593<xsl:template match="d:biblioid[@class='doi']" mode="bibtex">
594   <xsl:choose>
595    <xsl:when test=". = '???'">
596     <xsl:message> iii : no doi found for
597      <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
598     </xsl:message>
599    </xsl:when>
600    <xsl:otherwise>
601     <!-- ++ transformer 10.1029/2003GL018906 en un lien sur http://dx.doi.org/10.1029/2003GL018906 par exemple
602  -->
603      <xsl:text>, doi = {</xsl:text> <!-- ++ pas sûre, peut-être seulement note = {doi:..} -->
604      <xsl:value-of select="normalize-space(.)"/>
605    </xsl:otherwise>
606   </xsl:choose>
607 <xsl:text>}</xsl:text>
608</xsl:template>
609
610<xsl:template match="d:biblioid[@class='doi']" mode="raw">
611   <xsl:choose>
612    <xsl:when test=". = '???'">
613     <xsl:message> iii : no doi found for
614      <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
615     </xsl:message>
616    </xsl:when>
617    <xsl:otherwise>
618     <!-- transformer 10.1029/2003GL018906 en un lien sur http://dx.doi.org/10.1029/2003GL018906 par exemple -->
619     <xsl:text>, </xsl:text>
620     <xsl:element name="link">
621      <xsl:attribute name="xl:href">
622       <xsl:text>http://dx.doi.org/</xsl:text>
623       <xsl:value-of select="normalize-space(.)"/>
624      </xsl:attribute>
625      <xsl:text>doi:</xsl:text><xsl:value-of select="normalize-space(.)"/>
626     </xsl:element>
627    </xsl:otherwise>
628   </xsl:choose>
629</xsl:template>
630
631<xsl:template match="d:conftitle">
632 <xsl:text>, </xsl:text>
633 <xsl:value-of select="normalize-space(.)"/>
634</xsl:template>
635
636<xsl:template match="d:confdates">
637 <xsl:text>, </xsl:text>
638 <xsl:value-of select="normalize-space(.)"/>
639</xsl:template>
640
641<xsl:template match="d:confnum">
642 <xsl:text>, </xsl:text>
643 <xsl:value-of select="normalize-space(.)"/>
644</xsl:template>
645
646<xsl:template match="d:address" mode="raw">
647 <xsl:text>, </xsl:text>
648 <xsl:value-of select="normalize-space(.)"/>
649</xsl:template>
650
651<xsl:template match="d:address" mode="bibtex">
652 <xsl:text>, address = {</xsl:text>
653 <xsl:value-of select="normalize-space(.)"/>
654 <xsl:text>}</xsl:text>
655</xsl:template>
656
657<xsl:template match="d:biblioid" mode="raw">
658<xsl:choose>
659<xsl:when test="@class='doi'">
660 <xsl:apply-templates select="." mode="raw"/>
661</xsl:when>
662<xsl:when test="@class='isbn'">
663 <xsl:apply-templates select="." mode="raw"/>
664</xsl:when>
665<xsl:when test="@class='uri'">
666 <xsl:apply-templates select="." mode="raw"/>
667</xsl:when>
668<xsl:when test="@class='other'">
669 <xsl:apply-templates select="." mode="raw"/>
670</xsl:when>
671<xsl:otherwise>
672 <xsl:message terminate="yes">
673eee : unknown biblioid class for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
674eee : class : <xsl:value-of select="normalize-space(@class)"/>
675eee : value : <xsl:value-of select="normalize-space(.)"/>
676 </xsl:message>
677</xsl:otherwise>
678</xsl:choose>
679</xsl:template>
680
681<xsl:template match="d:biblioid" mode="bibtex">
682<xsl:choose>
683<xsl:when test="@class='doi'">
684 <xsl:apply-templates select="." mode="bibtex"/>
685</xsl:when>
686<xsl:when test="@class='isbn'">
687 <xsl:apply-templates select="." mode="bibtex"/>
688</xsl:when>
689<xsl:when test="@class='uri'">
690 <xsl:apply-templates select="." mode="bibtex"/>
691</xsl:when>
692<xsl:when test="@class='other'">
693 <xsl:apply-templates select="." mode="bibtex"/>
694</xsl:when>
695<xsl:otherwise>
696 <xsl:message terminate="yes">
697eee : unknown biblioid class for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
698eee : class : <xsl:value-of select="normalize-space(@class)"/>
699eee : value : <xsl:value-of select="normalize-space(.)"/>
700 </xsl:message>
701</xsl:otherwise>
702</xsl:choose>
703</xsl:template>
704
705<xsl:template match="d:bibliomisc" mode="raw">
706<xsl:choose>
707<xsl:when test="contains(.,'In Press') or contains(.,'In press') or contains(.,'in press') or contains(.,'in revision') or contains(.,'submitted')">
708 <xsl:text>, </xsl:text>
709 <xsl:value-of select="normalize-space(.)"/>
710</xsl:when>
711<xsl:otherwise>
712 <xsl:message terminate="no">
713eee : unknown bibliomisc purpose for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
714eee : <xsl:value-of select="normalize-space(.)"/>
715 </xsl:message>
716 <xsl:text>, </xsl:text>
717 <xsl:value-of select="normalize-space(.)"/>
718</xsl:otherwise>
719</xsl:choose>
720</xsl:template>
721
722<xsl:template match="d:bibliomisc" mode="bibtex">
723<xsl:choose>
724<xsl:when test="contains(.,'In Press') or contains(.,'In press') or contains(.,'in press') or contains(.,'in revision') or contains(.,'submitted')">
725   <xsl:text>, note = {</xsl:text>
726 <xsl:value-of select="normalize-space(.)"/>
727   <xsl:text>}</xsl:text>
728</xsl:when>
729<xsl:otherwise>
730 <xsl:message terminate="no">
731eee : unknown bibliomisc purpose for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
732eee : <xsl:value-of select="normalize-space(.)"/>
733 </xsl:message>
734 <xsl:text>, note = {</xsl:text>
735 <xsl:value-of select="normalize-space(.)"/>
736 <xsl:text>}</xsl:text>
737</xsl:otherwise>
738</xsl:choose>
739</xsl:template>
740
741</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.