source: trunk/biblioentry_xml.xsl @ 64

Last change on this file since 64 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: 11.2 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<!--
10module :
11traitement d'une référence bibliographique (biblioentry)
12
13update :
14$Id$
15fplod 2008-05-07T09:06:53Z aedon.locean-ipsl.upmc.fr (Darwin)
16improvements for conference
17fplod 2008-05-06T09:35:00Z aedon.locean-ipsl.upmc.fr (Darwin)
18add category choices
19fplod 2008-04-29T15:41:56Z aedon.locean-ipsl.upmc.fr (Darwin)
20chgt for dbk5 in
21fplod 2008-04-29T09:10:31Z aedon.locean-ipsl.upmc.fr (Darwin)
22chgt for dbk5 out
23fplod 2007-06-20T17:18:02Z aedon.locean-ipsl.upmc.fr (Darwin)
24<bibliomisc role="id"> replaced by <biblioid class="doi">
25fplod 2007-05-16T14:01:44Z aedon.locean-ipsl.upmc.fr (Darwin)
26correction in order to write doi only once
27fplod 2007-05-16T10:27:34Z aedon.locean-ipsl.upmc.fr (Darwin)
28remove biblioentry/date and publisher
29add biblioentry/biblioset/bibliomisc
30fplod 2007-05-15T07:37:46Z aedon.locean-ipsl.upmc.fr (Darwin)
31factorisation de biblioentry
32fplod 2007-05-14T15:48:04Z aedon.locean-ipsl.upmc.fr (Darwin)
33correction to add biblioentry/date (replace biblioentry/biblioset/pubdate)
34when "in press"
35fplod 2007-05-04T07:59:34Z aedon.locean-ipsl.upmc.fr (Darwin)
36factorisation de bibnemomaf01_xml.xsl, bibnemomaf02_xml.xsl,bibnemomaf04_xml.xsl
37-->
38
39<xsl:include href="correction_db.xsl"/>
40<xsl:include href="category_form.xsl"/>
41<xsl:include href="message_lang.xsl"/>
42
43<xsl:template name="one_biblioentry">
44 <xsl:param name="visu_modif"/>
45 <xsl:param name="my_biblioentry"/>
46 <xsl:element name="listitem">
47  <xsl:element name="para">
48    <xsl:apply-templates select="$my_biblioentry/d:authorgroup"/>
49    <xsl:text>, </xsl:text>
50    <xsl:if test="$my_biblioentry/descendant::d:pubdate">
51     <xsl:apply-templates select="$my_biblioentry/descendant::d:pubdate"/>
52    </xsl:if>
53    <xsl:if test="$my_biblioentry/descendant::d:date">
54     <xsl:apply-templates select="$my_biblioentry/descendant::d:date"/>
55    </xsl:if>
56    <xsl:text> : </xsl:text>
57    <xsl:apply-templates select="$my_biblioentry/d:title"/>
58    <xsl:text>, </xsl:text>
59    <xsl:choose>
60     <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='journal']">
61      <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:title"/>
62      <xsl:if test="$my_biblioentry/descendant::d:publishername">
63       <xsl:text>, </xsl:text>
64       <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername"/>
65      </xsl:if>
66      <xsl:if test="$my_biblioentry/descendant::d:publisher/d:address">
67       <xsl:text>, </xsl:text>
68       <xsl:apply-templates select="$my_biblioentry/descendant::d:publisher/d:address"/>
69      </xsl:if>
70      <xsl:if test="$my_biblioentry/descendant::d:volumenum">
71       <xsl:text>, </xsl:text>
72       <xsl:apply-templates select="$my_biblioentry/descendant::d:volumenum"/>
73       <xsl:if test="$my_biblioentry/descendant::d:issuenum">
74        <xsl:text>, </xsl:text>
75        <xsl:apply-templates select="$my_biblioentry/descendant::d:issuenum"/>
76       </xsl:if>
77      </xsl:if>
78      <xsl:if test="$my_biblioentry/descendant::d:pagenums">
79       <xsl:text>, </xsl:text>
80       <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums"/>
81      </xsl:if>
82      <xsl:if test="$my_biblioentry/descendant::d:biblioset/child::d:bibliomisc">
83       <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:bibliomisc"/>
84      </xsl:if>
85     </xsl:when>
86     <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='conference']">
87      <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:conftitle"/>
88      <xsl:if test="$my_biblioentry/descendant::d:biblioset/descendant::d:confnum">
89       <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:confnum"/>
90      </xsl:if>
91      <xsl:text>, </xsl:text>
92      <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:confdates"/>
93      <xsl:text>, </xsl:text>
94      <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:address"/>
95      <xsl:text>, </xsl:text>
96      <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:publishername"/>
97      <xsl:if test="$my_biblioentry/descendant::d:pagenums">
98       <xsl:text>, </xsl:text>
99       <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums"/>
100      </xsl:if>
101     </xsl:when>
102     <xsl:otherwise>
103      <xsl:message terminate="no">
104eee : unknown biblioset relation for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
105eee : <xsl:value-of select="$my_biblioentry/descendant::d:biblioset/@relation"/>
106      </xsl:message>
107      <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername"/>
108     </xsl:otherwise>
109    </xsl:choose>
110    <xsl:apply-templates select="$my_biblioentry/d:biblioid"/>
111  </xsl:element>
112  <xsl:if test="$visu_modif= 'modif'">
113   <xsl:call-template name="correction">
114    <xsl:with-param name="id" select="$my_biblioentry/@xml:id"/>
115   </xsl:call-template>
116  </xsl:if>
117  <xsl:if test="$visu_modif= 'category'">
118   <xsl:call-template name="category">
119    <xsl:with-param name="id" select="$my_biblioentry/@xml:id"/>
120   </xsl:call-template>
121  </xsl:if>
122 </xsl:element>
123</xsl:template>
124
125<xsl:template match="d:authorgroup">
126 <xsl:apply-templates select="d:author"/>
127 <xsl:apply-templates select="d:corpauthor"/>
128</xsl:template>
129
130<xsl:template match="d:author">
131<!--
1321er auteur Nom, prénom les autres Prenom Nom
133une virgule entre les auteurs sauf entre les deux derniers
134-->
135  <xsl:if test="d:personname/d:surname = ''">
136   <xsl:message>
137eee : empty surname for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
138   </xsl:message>
139  </xsl:if>
140  <xsl:if test="d:personname/d:firstname= ''">
141   <xsl:message>
142eee : empty firstname for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
143   </xsl:message>
144  </xsl:if>
145  <xsl:if test="d:personname/d:firstname= '.'">
146   <xsl:message>
147eee : firstname = '.' for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
148   </xsl:message>
149  </xsl:if>
150  <xsl:choose>
151   <xsl:when test="position()=1">
152    <xsl:value-of select="d:personname/d:surname"/><xsl:text>, </xsl:text>
153    <xsl:value-of select="d:personname/d:firstname"/>
154   </xsl:when>
155   <xsl:otherwise>
156    <xsl:value-of select="d:personname/d:firstname"/><xsl:text> </xsl:text>
157    <xsl:value-of select="d:personname/d:surname"/>
158   </xsl:otherwise>
159  </xsl:choose>
160
161<!--
162une virgule entre les auteurs sauf entre les deux derniers
163-->
164  <xsl:choose>
165   <xsl:when test="count(following-sibling::*)  &gt; 1"> <!-- plusieurs suivants -->
166    <xsl:text>, </xsl:text>
167   </xsl:when>
168   <xsl:when test="count(following-sibling::*)  = 1">
169    <!-- un suivant -->
170    <xsl:call-template name="and">
171     <xsl:with-param name="language" select="/d:bibliography/@xml:lang"/>
172    </xsl:call-template>
173   </xsl:when>
174  </xsl:choose>
175</xsl:template>
176
177<xsl:template match="d:corpauthor">
178<!--
179une virgule entre les auteurs sauf entre les deux derniers
180-->
181  <xsl:choose>
182   <xsl:when test="count(following-sibling::*)  &gt; 1"> <!-- plusieurs suivants -->
183    <xsl:text>, </xsl:text>
184   </xsl:when>
185   <xsl:when test="count(following-sibling::*)  = 1">
186    <xsl:text> and </xsl:text> <!-- un suivant -->
187   </xsl:when>
188  </xsl:choose>
189  <xsl:value-of select="normalize-space(.)"/>
190</xsl:template>
191<xsl:template match="d:biblioentry/d:title">
192  <xsl:value-of select="normalize-space(.)"/>
193</xsl:template>
194
195<xsl:template match="d:biblioset[@relation='journal']/d:title">
196  <xsl:value-of select="normalize-space(.)"/>
197</xsl:template>
198
199<xsl:template match="d:publishername">
200  <xsl:value-of select="normalize-space(.)"/>
201</xsl:template>
202
203<xsl:template match="d:biblioset[@relation='journal']/d:pubdate">
204  <xsl:value-of select="normalize-space(.)"/>
205</xsl:template>
206<xsl:template match="d:biblioset[@relation='conference']/d:pubdate">
207  <xsl:value-of select="normalize-space(.)"/>
208</xsl:template>
209<xsl:template match="d:date">
210 <xsl:message terminate="no">
211   eee : date
212   <xsl:value-of select="normalize-space(.)"/> exists in node
213   <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
214   eee : try to put information in biblioset
215 </xsl:message>
216</xsl:template>
217
218<xsl:template match="d:biblioset[@relation='journal']/d:volumenum">
219  <xsl:value-of select="normalize-space(.)"/>
220</xsl:template>
221
222<xsl:template match="d:biblioset[@relation='journal']/d:issuenum">
223  <xsl:value-of select="normalize-space(.)"/>
224</xsl:template>
225
226<xsl:template match="d:biblioset[@relation='journal']/d:pagesnum">
227  <xsl:value-of select="normalize-space(.)"/>
228</xsl:template>
229
230<xsl:template match="d:biblioset[@relation='conference']/d:publisher/d:publishername">
231  <xsl:value-of select="normalize-space(.)"/>
232</xsl:template>
233<xsl:template match="d:conftitle">
234  <xsl:value-of select="normalize-space(.)"/>
235</xsl:template>
236<xsl:template match="d:confdates">
237  <xsl:value-of select="normalize-space(.)"/>
238</xsl:template>
239<xsl:template match="d:confnum">
240  <xsl:value-of select="normalize-space(.)"/>
241</xsl:template>
242<xsl:template match="d:address">
243  <xsl:value-of select="normalize-space(.)"/>
244</xsl:template>
245
246<xsl:template match="d:biblioid">
247<xsl:choose>
248<xsl:when test="@class='doi'">
249 <xsl:choose>
250  <xsl:when test=". = '???'">
251   <xsl:message> iii : no doi found for
252    <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
253   </xsl:message>
254  </xsl:when>
255 <xsl:otherwise>
256  <!-- transformer 10.1029/2003GL018906 en un lien sur http://dx.doi.org/10.1029/2003GL018906 par exemple
257  -->
258  <xsl:text>, </xsl:text>
259  <xsl:element name="link">
260   <xsl:attribute name="xl:href">
261    <xsl:text>http://dx.doi.org/</xsl:text>
262    <xsl:value-of select="normalize-space(.)"/>
263   </xsl:attribute>
264   <xsl:text>doi:</xsl:text><xsl:value-of select="normalize-space(.)"/>
265  </xsl:element>
266 </xsl:otherwise>
267 </xsl:choose>
268</xsl:when>
269<xsl:when test="@class='isbn'">
270 <xsl:text>, ISBN : </xsl:text><xsl:value-of select="normalize-space(.)"/>
271</xsl:when>
272<xsl:when test="@class='other'">
273 <xsl:text>, </xsl:text><xsl:value-of select="@otherclass"/><xsl:text> : </xsl:text><xsl:value-of select="normalize-space(.)"/>
274</xsl:when>
275<xsl:otherwise>
276 <xsl:message terminate="no">
277eee : unknown biblioid class for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
278eee : <xsl:value-of select="normalize-space(.)"/>
279 </xsl:message>
280</xsl:otherwise>
281</xsl:choose>
282</xsl:template>
283
284<xsl:template match="d:bibliomisc">
285<xsl:choose>
286<xsl:when test="contains(.,'In Press')">
287 <xsl:text>, </xsl:text>
288 <xsl:value-of select="normalize-space(.)"/>
289</xsl:when>
290<xsl:when test="contains(.,'In press')">
291 <xsl:text>, </xsl:text>
292 <xsl:value-of select="normalize-space(.)"/>
293</xsl:when>
294<xsl:when test="contains(.,'in press')">
295 <xsl:text>, </xsl:text>
296 <xsl:value-of select="normalize-space(.)"/>
297</xsl:when>
298<xsl:when test="contains(.,'in revision')">
299 <xsl:text>, </xsl:text>
300 <xsl:value-of select="normalize-space(.)"/>
301</xsl:when>
302<xsl:when test="contains(.,'submitted')">
303 <xsl:text>, </xsl:text>
304 <xsl:value-of select="normalize-space(.)"/>
305</xsl:when>
306<xsl:otherwise>
307 <xsl:message>
308eee : unknown bibliomisc purpose for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
309eee : <xsl:value-of select="normalize-space(.)"/>
310 </xsl:message>
311</xsl:otherwise>
312</xsl:choose>
313</xsl:template>
314
315</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.