source: trunk/biblioentry_xml.xsl @ 8

Last change on this file since 8 was 2, checked in by smasson, 17 years ago

initial import

File size: 7.2 KB
Line 
1<?xml version="1.0" encoding="iso-8859-1"?>
2
3<!--
4module :
5traitement d'une référence bibliographique (biblioentry)
6
7source :
8/usr/home/fplod/incas/bibnemo/src/bibnemomaf/biblioentry_xml.xsl sur aedon.locean-ipsl.upmc.fr
9
10update :
11fplod 2007-05-16T14:01:44Z aedon.locean-ipsl.upmc.fr (Darwin)
12correction in order to write doi only once
13fplod 2007-05-16T10:27:34Z aedon.locean-ipsl.upmc.fr (Darwin)
14remove biblioentry/date and publisher
15add  biblioentry/biblioset/biliomisc
16fplod 2007-05-15T07:37:46Z aedon.locean-ipsl.upmc.fr (Darwin)
17factorisation de biblioentry
18fplod 2007-05-14T15:48:04Z aedon.locean-ipsl.upmc.fr (Darwin)
19correction to add biblioentry/date (replace biblioentry/biblioset/pubdate)
20when "in press"
21fplod 2007-05-04T07:59:34Z aedon.locean-ipsl.upmc.fr (Darwin)
22factorisation de bibnemomaf01_xml.xsl, bibnemomaf02_xml.xsl,bibnemomaf04_xml.xsl
23-->
24
25<xsl:stylesheet
26 id="id" version="1.0"
27 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
28
29<xsl:include href="correction_db.xsl"/>
30
31<xsl:template name="one_biblioentry">
32 <xsl:param name="visu_modif"/>
33 <xsl:param name="my_biblioentry"/>
34 <xsl:element name="listitem">
35  <xsl:element name="para">
36    <xsl:apply-templates select="$my_biblioentry/authorgroup"/>
37    <xsl:text>, </xsl:text>
38    <xsl:if test="$my_biblioentry/descendant::pubdate">
39     <xsl:apply-templates select="$my_biblioentry/descendant::pubdate"/>
40    </xsl:if>
41    <xsl:if test="$my_biblioentry/descendant::date">
42     <xsl:apply-templates select="$my_biblioentry/descendant::date"/>
43    </xsl:if>
44    <xsl:text> : </xsl:text>
45    <xsl:apply-templates select="$my_biblioentry/title"/>
46    <xsl:text>, </xsl:text>
47    <xsl:choose>
48     <xsl:when test="$my_biblioentry/descendant::biblioset">
49      <xsl:apply-templates select="$my_biblioentry/descendant::biblioset/child::title"/>
50      <xsl:if test="$my_biblioentry/descendant::volumenum">
51       <xsl:text>, </xsl:text>
52       <xsl:apply-templates select="$my_biblioentry/descendant::volumenum"/>
53       <xsl:if test="$my_biblioentry/descendant::issuenum">
54        <xsl:text>, </xsl:text>
55        <xsl:apply-templates select="$my_biblioentry/descendant::issuenum"/>
56       </xsl:if>
57      </xsl:if>
58      <xsl:if test="$my_biblioentry/descendant::pagenums">
59       <xsl:text>, </xsl:text>
60       <xsl:apply-templates select="$my_biblioentry/descendant::pagenums"/>
61      </xsl:if>
62      <xsl:if test="$my_biblioentry/descendant::biblioset/child::bibliomisc">
63       <xsl:apply-templates select="$my_biblioentry/descendant::biblioset/child::bibliomisc"/>
64      </xsl:if>
65     </xsl:when>
66     <xsl:otherwise>
67      <xsl:apply-templates select="$my_biblioentry/publishername"/>
68     </xsl:otherwise>
69    </xsl:choose>
70    <xsl:apply-templates select="$my_biblioentry/bibliomisc"/>
71  </xsl:element>
72  <xsl:if test="$visu_modif= 'modif'">
73   <xsl:call-template name="correction">
74    <xsl:with-param name="id" select="$my_biblioentry/@id"/>
75   </xsl:call-template>
76  </xsl:if>
77 </xsl:element>
78</xsl:template>
79
80<xsl:template match="authorgroup">
81 <xsl:apply-templates select="author"/>
82 <xsl:apply-templates select="corpauthor"/>
83</xsl:template>
84
85<xsl:template match="author">
86<!--
871er auteur Nom, prénom les autres Prenom Nom
88une virgule entre les auteurs sauf entre les deux derniers
89-->
90  <xsl:if test="personname/surname = ''">
91   <xsl:message>
92eee : empty surname for <xsl:value-of select="ancestor::biblioentry/@id"/>
93   </xsl:message>
94  </xsl:if>
95  <xsl:if test="personname/firstname= ''">
96   <xsl:message>
97eee : empty firstname for <xsl:value-of select="ancestor::biblioentry/@id"/>
98   </xsl:message>
99  </xsl:if>
100  <xsl:if test="personname/firstname= '.'">
101   <xsl:message>
102eee : firstname = '.' for <xsl:value-of select="ancestor::biblioentry/@id"/>
103   </xsl:message>
104  </xsl:if>
105  <xsl:choose>
106   <xsl:when test="position()=1">
107    <xsl:value-of select="personname/surname"/><xsl:text>, </xsl:text>
108    <xsl:value-of select="personname/firstname"/>
109   </xsl:when>
110   <xsl:otherwise>
111    <xsl:value-of select="personname/firstname"/><xsl:text> </xsl:text>
112    <xsl:value-of select="personname/surname"/>
113   </xsl:otherwise>
114  </xsl:choose>
115
116<!--
117une virgule entre les auteurs sauf entre les deux derniers
118-->
119  <xsl:choose>
120   <xsl:when test="count(following-sibling::*)  &gt; 1"> <!-- plusieurs suivants -->
121    <xsl:text>, </xsl:text>
122   </xsl:when>
123   <xsl:when test="count(following-sibling::*)  = 1">
124    <xsl:text> and </xsl:text> <!-- un suivant -->
125   </xsl:when>
126  </xsl:choose>
127</xsl:template>
128
129<xsl:template match="corpauthor">
130<!--
131une virgule entre les auteurs sauf entre les deux derniers
132-->
133  <xsl:choose>
134   <xsl:when test="count(following-sibling::*)  &gt; 1"> <!-- plusieurs suivants -->
135    <xsl:text>, </xsl:text>
136   </xsl:when>
137   <xsl:when test="count(following-sibling::*)  = 1">
138    <xsl:text> and </xsl:text> <!-- un suivant -->
139   </xsl:when>
140  </xsl:choose>
141  <xsl:value-of select="."/>
142</xsl:template>
143<xsl:template match="biblioentry/title">
144  <xsl:value-of select="."/>
145</xsl:template>
146
147<xsl:template match="biblioset[@relation='journal']/title">
148  <xsl:value-of select="."/>
149</xsl:template>
150<xsl:template match="publishername">
151 <xsl:message terminate="no">
152   eee : publishername
153   <xsl:value-of select="."/> exists in node
154   <xsl:value-of select="ancestor::biblioentry/@id"/>
155   eee : try to put information in biblioset
156 </xsl:message>
157</xsl:template>
158<xsl:template match="biblioset[@relation='journal']/pubdate">
159  <xsl:value-of select="."/>
160</xsl:template>
161<xsl:template match="date">
162 <xsl:message terminate="no">
163   eee : date
164   <xsl:value-of select="."/> exists in node
165   <xsl:value-of select="ancestor::biblioentry/@id"/>
166   eee : try to put information in biblioset
167 </xsl:message>
168</xsl:template>
169<xsl:template match="biblioset[@relation='journal']/volumenum">
170  <xsl:value-of select="."/>
171</xsl:template>
172<xsl:template match="biblioset[@relation='journal']/issuenum">
173  <xsl:value-of select="."/>
174</xsl:template>
175<xsl:template match="biblioset[@relation='journal']/pagesnum">
176  <xsl:value-of select="."/>
177</xsl:template>
178
179<xsl:template match="bibliomisc">
180<xsl:choose>
181<xsl:when test="contains(.,'In Press')">
182 <xsl:text>, </xsl:text>
183 <xsl:value-of select="."/>
184</xsl:when>
185<xsl:when test="contains(.,'In press')">
186 <xsl:text>, </xsl:text>
187 <xsl:value-of select="."/>
188</xsl:when>
189<xsl:when test="contains(.,'in press')">
190 <xsl:text>, </xsl:text>
191 <xsl:value-of select="."/>
192</xsl:when>
193<xsl:when test="contains(.,'in revision')">
194 <xsl:text>, </xsl:text>
195 <xsl:value-of select="."/>
196</xsl:when>
197<xsl:when test="@role='doi'"> <!-- ++ si doi existe et different de ??? -->
198 <xsl:choose>
199  <xsl:when test=". = '???'">
200   <xsl:message> iii : no doi found for
201<xsl:value-of select="ancestor::biblioentry/@id"/>
202</xsl:message>
203  </xsl:when>
204 <xsl:otherwise>
205  <!-- transformer 10.1029/2003GL018906 en un lien sur http://dx.doi.org/10.1029/2003GL018906 par exemple
206  -->
207  <xsl:text>, </xsl:text>
208  <xsl:element name="ulink">
209   <xsl:attribute name="url">
210    <xsl:text>http://dx.doi.org/</xsl:text>
211    <xsl:value-of select="."/>
212   </xsl:attribute>
213   doi:<xsl:value-of select="."/>
214  </xsl:element>
215 </xsl:otherwise>
216 </xsl:choose>
217</xsl:when>
218<xsl:otherwise>
219 <xsl:message>
220eee : unknown bibliomisc purpose for <xsl:value-of select="ancestor::biblioentry/@id"/>
221eee : <xsl:value-of select="."/>
222 </xsl:message>
223</xsl:otherwise>
224</xsl:choose>
225</xsl:template>
226
227</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.