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