source: trunk/biblioentry_xml.xsl @ 45

Last change on this file since 45 was 33, checked in by pinsard, 17 years ago

add Id in many headers; replace bibrefnemo.xml by biblio.xml

  • Property svn:keywords set to Id
File size: 7.5 KB
Line 
1<?xml version="1.0" encoding="iso-8859-1"?>
2
3<!--
4module :
5traitement d'une référence bibliographique (biblioentry)
6
7update :
8$Id$
9fplod 2007-06-20T17:18:02Z aedon.locean-ipsl.upmc.fr (Darwin)
10<bibliomisc role="id"> replaced by <biblioid class="doi">
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/biblioid"/>
71    <xsl:apply-templates select="$my_biblioentry/bibliomisc"/>
72  </xsl:element>
73  <xsl:if test="$visu_modif= 'modif'">
74   <xsl:call-template name="correction">
75    <xsl:with-param name="id" select="$my_biblioentry/@id"/>
76   </xsl:call-template>
77  </xsl:if>
78 </xsl:element>
79</xsl:template>
80
81<xsl:template match="authorgroup">
82 <xsl:apply-templates select="author"/>
83 <xsl:apply-templates select="corpauthor"/>
84</xsl:template>
85
86<xsl:template match="author">
87<!--
881er auteur Nom, prénom les autres Prenom Nom
89une virgule entre les auteurs sauf entre les deux derniers
90-->
91  <xsl:if test="personname/surname = ''">
92   <xsl:message>
93eee : empty surname for <xsl:value-of select="ancestor::biblioentry/@id"/>
94   </xsl:message>
95  </xsl:if>
96  <xsl:if test="personname/firstname= ''">
97   <xsl:message>
98eee : empty firstname for <xsl:value-of select="ancestor::biblioentry/@id"/>
99   </xsl:message>
100  </xsl:if>
101  <xsl:if test="personname/firstname= '.'">
102   <xsl:message>
103eee : firstname = '.' for <xsl:value-of select="ancestor::biblioentry/@id"/>
104   </xsl:message>
105  </xsl:if>
106  <xsl:choose>
107   <xsl:when test="position()=1">
108    <xsl:value-of select="personname/surname"/><xsl:text>, </xsl:text>
109    <xsl:value-of select="personname/firstname"/>
110   </xsl:when>
111   <xsl:otherwise>
112    <xsl:value-of select="personname/firstname"/><xsl:text> </xsl:text>
113    <xsl:value-of select="personname/surname"/>
114   </xsl:otherwise>
115  </xsl:choose>
116
117<!--
118une virgule entre les auteurs sauf entre les deux derniers
119-->
120  <xsl:choose>
121   <xsl:when test="count(following-sibling::*)  &gt; 1"> <!-- plusieurs suivants -->
122    <xsl:text>, </xsl:text>
123   </xsl:when>
124   <xsl:when test="count(following-sibling::*)  = 1">
125    <xsl:text> and </xsl:text> <!-- un suivant -->
126   </xsl:when>
127  </xsl:choose>
128</xsl:template>
129
130<xsl:template match="corpauthor">
131<!--
132une virgule entre les auteurs sauf entre les deux derniers
133-->
134  <xsl:choose>
135   <xsl:when test="count(following-sibling::*)  &gt; 1"> <!-- plusieurs suivants -->
136    <xsl:text>, </xsl:text>
137   </xsl:when>
138   <xsl:when test="count(following-sibling::*)  = 1">
139    <xsl:text> and </xsl:text> <!-- un suivant -->
140   </xsl:when>
141  </xsl:choose>
142  <xsl:value-of select="."/>
143</xsl:template>
144<xsl:template match="biblioentry/title">
145  <xsl:value-of select="."/>
146</xsl:template>
147
148<xsl:template match="biblioset[@relation='journal']/title">
149  <xsl:value-of select="."/>
150</xsl:template>
151<xsl:template match="publishername">
152 <xsl:message terminate="no">
153   eee : publishername
154   <xsl:value-of select="."/> exists in node
155   <xsl:value-of select="ancestor::biblioentry/@id"/>
156   eee : try to put information in biblioset
157 </xsl:message>
158</xsl:template>
159<xsl:template match="biblioset[@relation='journal']/pubdate">
160  <xsl:value-of select="."/>
161</xsl:template>
162<xsl:template match="date">
163 <xsl:message terminate="no">
164   eee : date
165   <xsl:value-of select="."/> exists in node
166   <xsl:value-of select="ancestor::biblioentry/@id"/>
167   eee : try to put information in biblioset
168 </xsl:message>
169</xsl:template>
170
171<xsl:template match="biblioset[@relation='journal']/volumenum">
172  <xsl:value-of select="."/>
173</xsl:template>
174
175<xsl:template match="biblioset[@relation='journal']/issuenum">
176  <xsl:value-of select="."/>
177</xsl:template>
178
179<xsl:template match="biblioset[@relation='journal']/pagesnum">
180  <xsl:value-of select="."/>
181</xsl:template>
182
183<xsl:template match="biblioid">
184<xsl:choose>
185<xsl:when test="@class='doi'">
186 <xsl:choose>
187  <xsl:when test=". = '???'">
188   <xsl:message> iii : no doi found for
189    <xsl:value-of select="ancestor::biblioentry/@id"/>
190   </xsl:message>
191  </xsl:when>
192 <xsl:otherwise>
193  <!-- transformer 10.1029/2003GL018906 en un lien sur http://dx.doi.org/10.1029/2003GL018906 par exemple
194  -->
195  <xsl:text>, </xsl:text>
196  <xsl:element name="ulink">
197   <xsl:attribute name="url">
198    <xsl:text>http://dx.doi.org/</xsl:text>
199    <xsl:value-of select="."/>
200   </xsl:attribute>
201   doi:<xsl:value-of select="."/>
202  </xsl:element>
203 </xsl:otherwise>
204 </xsl:choose>
205</xsl:when>
206<xsl:otherwise>
207 <xsl:message>
208eee : unknown biblioid purpose for <xsl:value-of select="ancestor::biblioentry/@id"/>
209eee : <xsl:value-of select="."/>
210 </xsl:message>
211</xsl:otherwise>
212</xsl:choose>
213</xsl:template>
214
215<xsl:template match="bibliomisc">
216<xsl:choose>
217<xsl:when test="contains(.,'In Press')">
218 <xsl:text>, </xsl:text>
219 <xsl:value-of select="."/>
220</xsl:when>
221<xsl:when test="contains(.,'In press')">
222 <xsl:text>, </xsl:text>
223 <xsl:value-of select="."/>
224</xsl:when>
225<xsl:when test="contains(.,'in press')">
226 <xsl:text>, </xsl:text>
227 <xsl:value-of select="."/>
228</xsl:when>
229<xsl:when test="contains(.,'in revision')">
230 <xsl:text>, </xsl:text>
231 <xsl:value-of select="."/>
232</xsl:when>
233<xsl:otherwise>
234 <xsl:message>
235eee : unknown bibliomisc purpose for <xsl:value-of select="ancestor::biblioentry/@id"/>
236eee : <xsl:value-of select="."/>
237 </xsl:message>
238</xsl:otherwise>
239</xsl:choose>
240</xsl:template>
241
242</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.