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