Filtered repeated description element text so that only unique text occurs in the...
[cdmlib.git] / cdmlib-print / src / main / resources / stylesheets / pdf / flore-afrique-centrale.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE xsl:stylesheet [<!ENTITY mdash "&#x2014;">]>
3
4 <!--
5
6 CDM XSL Transformation
7 Target Format: Flore d'Afrique Centrale
8
9 -->
10 <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
11 xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
12
13 <!-- ############### Constants and definitions ################### -->
14
15 <!-- **********************************
16 ** global definitions
17 *********************************** -->
18 <xsl:param name="global-family-font">Times</xsl:param>
19 <xsl:param name="global-size-font">10pt</xsl:param>
20 <xsl:param name="global-line-height">12pt</xsl:param>
21
22 <xsl:param name="global-width-page">159mm</xsl:param>
23 <xsl:param name="global-height-page">244mm</xsl:param>
24
25 <xsl:param name="global-indentation">0mm</xsl:param>
26
27 <!-- **********************************
28 ** definitions for taxon pages
29 *********************************** -->
30 <xsl:param name="taxon-page-top-margin">32mm</xsl:param>
31 <xsl:param name="taxon-page-inner-margin">21mm</xsl:param>
32 <xsl:param name="taxon-page-bottom-margin">32mm</xsl:param>
33 <xsl:param name="graphic-height">150mm</xsl:param>
34
35 <xsl:param name="taxon-region-body-outer-margin">24mm</xsl:param>
36
37 <xsl:param name="taxon-region-before-extent">0mm</xsl:param>
38 <xsl:param name="taxon-region-after-extent">0mm</xsl:param>
39
40 <xsl:param name="content-bg-color">white</xsl:param>
41 <xsl:param name="taxon-header-family-font">Times</xsl:param>
42 <xsl:param name="taxon-header-before-bg-color">white</xsl:param>
43 <xsl:param name="taxon-header-after-bg-color">white</xsl:param>
44 <xsl:param name="taxon-header-size-font">7pt</xsl:param>
45
46
47 <xsl:param name="taxon-name-indentation">4mm</xsl:param>
48 <xsl:param name="taxon-name-size-font">8pt</xsl:param>
49 <xsl:param name="taxon-name-line-height">9.6pt</xsl:param>
50
51 <xsl:param name="taxon-header-style-font">italic</xsl:param>
52 <xsl:param name="taxon-header-page-number-size-font">10pt</xsl:param>
53 <xsl:param name="taxon-header-page-number-align-text">end</xsl:param>
54
55 <xsl:param name="taxon-page-number-initial">1</xsl:param>
56
57 <!-- hardcoded ranks -->
58 <xsl:param name="uuidFamily">210a8214-4e69-401a-8e47-c7940d990bdd</xsl:param>
59 <xsl:param name="uuidGenus">1b11c34c-48a8-4efa-98d5-84f7f66ef43a</xsl:param>
60 <xsl:param name="uuidSubgenus">78786e16-2a70-48af-a608-494023b91904</xsl:param>
61
62 <!-- **********************************
63 ** html support
64 *********************************** -->
65
66 <!-- format html i tags in text as italic -->
67 <!--xsl:template match="i">
68 <fo:inline font-style="italic">
69 <xsl:value-of select="."/>
70 </fo:inline>
71 </xsl:template-->
72
73 <!-- format html b tags in text as bold -->
74 <xsl:template match="b">
75 <fo:inline font-weight="bold">
76 <xsl:apply-templates/>
77 </fo:inline>
78 </xsl:template>
79
80 <!-- ########################################################################## -->
81
82
83 <!-- start xsl output -->
84 <xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="no"/>
85 <xsl:param name="versionParam" select="'1.0'"/>
86
87 <!-- root element: root -->
88 <xsl:template match="root">
89 <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
90
91 <!-- defines page layout -->
92 <fo:layout-master-set>
93
94 <!-- layout for odd taxon pages -->
95 <fo:simple-page-master
96 master-name="taxon_page_odd"
97 page-height="{$global-height-page}"
98 page-width="{$global-width-page}"
99 margin-top="{$taxon-page-top-margin}"
100 margin-bottom="{$taxon-page-bottom-margin}"
101 margin-left="{$taxon-page-inner-margin}"
102 margin-right="">
103 <fo:region-body
104 margin-right="{$taxon-region-body-outer-margin}"/>
105 <fo:region-before extent="{$taxon-region-before-extent}" region-name="odd-before"/>
106 <fo:region-after extent="{$taxon-region-after-extent}" region-name="odd-after"/>
107 </fo:simple-page-master>
108
109 <!-- layout for even taxon pages -->
110 <fo:simple-page-master
111 master-name="taxon_page_even"
112 page-height="{$global-height-page}"
113 page-width="{$global-width-page}"
114 margin-top="{$taxon-page-top-margin}"
115 margin-bottom="{$taxon-page-bottom-margin}"
116 margin-left="0"
117 margin-right="{$taxon-page-inner-margin}">
118 <fo:region-body
119 margin-left="{$taxon-region-body-outer-margin}"/>
120 <fo:region-before extent="{$taxon-region-before-extent}" region-name="even-before"/>
121 <fo:region-after extent="{$taxon-region-after-extent}" region-name="even-after"/>
122
123 <!--fo:leader leader-pattern="rule" leader-length="10mm"/-->
124
125 </fo:simple-page-master>
126
127
128 <!-- defines repeatable page-sequence for layout of taxa -->
129 <fo:page-sequence-master master-name="taxon_page">
130 <fo:repeatable-page-master-alternatives>
131 <fo:conditional-page-master-reference master-reference="taxon_page_odd"
132 page-position="first"/>
133 <fo:conditional-page-master-reference master-reference="taxon_page_even"
134 page-position="rest" odd-or-even="even"/>
135 <fo:conditional-page-master-reference master-reference="taxon_page_odd"
136 page-position="rest" odd-or-even="odd"/>
137 <!-- <fo:conditional-page-master-reference master-reference="mclBoook_taxon_page_even"
138 page-position="last"/>-->
139 </fo:repeatable-page-master-alternatives>
140 </fo:page-sequence-master>
141 </fo:layout-master-set>
142 <!-- end: defines page layout -->
143
144 <!-- page sequence for taxon view -->
145 <fo:page-sequence master-reference="taxon_page"
146 initial-page-number="{$taxon-page-number-initial}" force-page-count="no-force">
147
148 <fo:static-content flow-name="odd-before">
149 <xsl:call-template name="right-extent"/>
150 </fo:static-content>
151
152 <fo:static-content flow-name="even-before">
153 <xsl:call-template name="left-extent"/>
154 </fo:static-content>
155
156 <!-- format taxa -->
157 <fo:flow flow-name="xsl-region-body">
158 <fo:block font-family="{$global-family-font}" font-size="{$global-size-font}"
159 line-height="{$global-line-height}">
160 <xsl:for-each select="//TaxonNode">
161 <xsl:apply-templates select="."/>
162 </xsl:for-each>
163 </fo:block>
164 </fo:flow>
165
166 </fo:page-sequence>
167 </fo:root>
168 </xsl:template>
169
170 <!-- HEADER -->
171
172 <xsl:template name="right-extent">
173
174 <fo:block font-family="{$taxon-header-family-font}" font-style="{$taxon-header-style-font}"
175 font-size="{$taxon-header-size-font}">
176 <!-- No pagination at the moment
177 <fo:block font-size="{$taxon-header-page-number-size-font}"
178 text-align="{$taxon-header-page-number-align-text}"> &#x2014; <fo:page-number/> &#x2014; </fo:block>
179 <fo:block color="white">-</fo:block> -->
180 <fo:block>
181 <fo:retrieve-marker retrieve-class-name="pageTitleMarker"
182 retrieve-position="first-starting-within-page" retrieve-boundary="document"/>
183 <xsl:text> </xsl:text>
184 <fo:retrieve-marker retrieve-class-name="pageTitleSectionMarker"
185 retrieve-position="first-starting-within-page" retrieve-boundary="document"/>
186 </fo:block>
187 </fo:block>
188
189 </xsl:template>
190
191 <xsl:template name="left-extent">
192 <fo:block font-family="{$taxon-header-family-font}" font-style="{$taxon-header-style-font}"
193 font-size="{$taxon-header-size-font}">
194 <!-- No pagination at the moment
195 <fo:block font-size="{$taxon-header-page-number-size-font}"
196 text-align="{$taxon-header-page-number-align-text}"> &#x2014; <fo:page-number/> &#x2014;
197 </fo:block> -->
198 </fo:block>
199 </xsl:template>
200
201 <!--xsl:template name="odd-after-header">
202 <fo:block font-family="{$taxon-header-family-font}" font-style="{$taxon-header-style-font}"
203 font-size="{$taxon-header-size-font}">
204 <fo:block>
205 <fo:inline>
206 <fo:retrieve-marker retrieve-class-name="pageTitleMarker"
207 retrieve-position="last-starting-within-page" retrieve-boundary="document"/>
208 <fo:retrieve-marker retrieve-class-name="pageTitleSectionMarker"
209 retrieve-position="last-starting-within-page" retrieve-boundary="document"/>
210 </fo:inline>
211 </fo:block>
212 </fo:block>
213 </xsl:template-->
214
215
216 <!--xsl:template name="even-before-header">
217 <fo:block font-family="{$taxon-header-family-font}" font-style="{$taxon-header-style-font}"
218 font-size="{$taxon-header-size-font}"-->
219 <!--
220 No pagination at the moment
221 <fo:block color="white" font-size="{$taxon-header-page-number-size-font}">-</fo:block>
222 <fo:block color="white">-</fo:block>-->
223 <!--
224 <fo:block>
225 <fo:inline>
226 <fo:retrieve-marker retrieve-class-name="pageTitleMarker"
227 retrieve-position="first-starting-within-page" retrieve-boundary="document"/>
228 <fo:retrieve-marker retrieve-class-name="pageTitleSectionMarker"
229 retrieve-position="first-starting-within-page" retrieve-boundary="document"/>
230 </fo:inline>
231 </fo:block>
232 </fo:block>
233
234 </xsl:template-->
235
236 <xsl:template name="even-after-header">
237 <fo:block font-family="{$taxon-header-family-font}" font-style="{$taxon-header-style-font}"
238 font-size="{$taxon-header-size-font}">
239 <fo:block>
240 <fo:inline>
241 <fo:retrieve-marker retrieve-class-name="pageTitleMarker"
242 retrieve-position="last-starting-within-page" retrieve-boundary="document"/>
243 <fo:retrieve-marker retrieve-class-name="pageTitleSectionMarker"
244 retrieve-position="last-starting-within-page" retrieve-boundary="document"/>
245 </fo:inline>
246 </fo:block>
247 <!-- No pagination at the moment
248 <fo:block color="white">-</fo:block>
249 <fo:block font-size="{$taxon-header-page-number-size-font}"
250 text-align="{$taxon-header-page-number-align-text}"> &#x2014; <fo:page-number/> &#x2014;
251 </fo:block> -->
252 </fo:block>
253 </xsl:template>
254
255 <!-- GENERAL -->
256
257 <xsl:template match="TaxonNode" name="TaxonNode">
258 <xsl:apply-templates select="Taxon"/>
259 </xsl:template>
260
261 <xsl:template match="Taxon" name="Taxon">
262 <xsl:call-template name="title"/>
263 <xsl:apply-templates select="synonymy"/>
264 <xsl:apply-templates select="descriptions"/>
265 </xsl:template>
266
267
268 <xsl:template name="title">
269 <fo:block margin-bottom="5mm">
270 <!-- we need to find a way to store the uuid in a variable xsl:parameter did not work or i was using it wrong -->
271 <xsl:choose>
272 <!-- family -->
273 <xsl:when test="name/rank/uuid='af5f2481-3192-403f-ae65-7c957a0f02b6'">
274 <fo:block text-align="center" text-transform="uppercase">
275 <xsl:apply-templates select="name/genusOrUninomial"/>
276 </fo:block>
277 </xsl:when>
278 <!-- genus -->
279 <xsl:when test="name/rank/uuid='1b11c34c-48a8-4efa-98d5-84f7f66ef43a'">
280 <fo:block font-weight="bold" text-align="center" text-transform="uppercase">
281 <xsl:apply-templates select="name/genusOrUninomial"/>
282 </fo:block>
283 </xsl:when>
284 <!-- subgenus -->
285 <xsl:when test="name/rank/uuid='78786e16-2a70-48af-a608-494023b91904'">
286 <fo:block font-weight="bold" text-align="center">
287 <xsl:apply-templates select="name/rank/representation_L10n"/>
288 <xsl:text> </xsl:text>
289 <xsl:apply-templates select="name/genusOrUninomial"/>
290 </fo:block>
291 </xsl:when>
292 <!-- species -->
293 <xsl:when test="name/rank/uuid='b301f787-f319-4ccc-a10f-b4ed3b99a86d'">
294 <fo:block font-weight="bold" text-align="center">
295 <xsl:apply-templates select="name/genusOrUninomial"/>
296 <xsl:text> </xsl:text>
297 <xsl:apply-templates select="name/specificEpithet"/>
298 </fo:block>
299 </xsl:when>
300 <xsl:otherwise>
301 <!-- for debugging --> Unformatted title for rank uuid: <xsl:value-of
302 select="name/rank/uuid"/>: <xsl:value-of select="name/titleCache"/>
303 </xsl:otherwise>
304 </xsl:choose>
305 </fo:block>
306 </xsl:template>
307
308 <!-- NAME -->
309
310 <xsl:template match="name">
311 <xsl:apply-templates select="taggedName"/>
312 <xsl:apply-templates select="nomenclaturalReference"/>
313 </xsl:template>
314
315 <xsl:template match="taggedName">
316 <xsl:for-each select="e">
317 <xsl:choose>
318 <xsl:when test="type='name'">
319 <fo:inline font-style="italic">
320 <xsl:value-of select="text"/>
321 </fo:inline>
322 <xsl:text> </xsl:text>
323 </xsl:when>
324 <xsl:when test="type='authors'">
325 <xsl:value-of select="text"/>
326 </xsl:when>
327 <xsl:otherwise>
328 <xsl:value-of select="text"/>
329 <xsl:text> </xsl:text>
330 </xsl:otherwise>
331 </xsl:choose>
332 </xsl:for-each>
333 </xsl:template>
334
335 <!-- first date in brackets -->
336 <xsl:template match="nomenclaturalReference">
337 <xsl:text> (</xsl:text>
338 <fo:inline>
339 <xsl:value-of select="authorTeam/titleCache"/>
340 <xsl:text> </xsl:text>
341 <xsl:value-of select="datePublished/start"/>:
342 </fo:inline>
343 <xsl:text> </xsl:text>
344 <fo:inline>
345 <xsl:value-of select="../nomenclaturalMicroReference"/>
346 </fo:inline>
347 <xsl:text>)</xsl:text>
348 </xsl:template>
349
350 <!-- DESCRIPTIONS -->
351
352 <xsl:template match="descriptions" name="descriptions">
353 <xsl:for-each select="features/feature">
354 <xsl:choose>
355 <xsl:when test="count(feature)!=0">
356 <xsl:call-template name="secondLevelDescriptionElements"/>
357 </xsl:when>
358 <xsl:otherwise>
359 <!-- everything except Citation -->
360 <xsl:if test="uuid!='99b2842f-9aa7-42fa-bd5f-7285311e0101'">
361 <xsl:call-template name="descriptionElements"/>
362 </xsl:if>
363 </xsl:otherwise>
364 </xsl:choose>
365 </xsl:for-each>
366 </xsl:template>
367
368 <xsl:template name="descriptionElements">
369 <xsl:choose>
370 <xsl:when test="supportsCommonTaxonName='true'">
371 <xsl:call-template name="commonTaxonName"/>
372 </xsl:when>
373 <xsl:otherwise>
374 <xsl:call-template name="textData"/>
375 </xsl:otherwise>
376 </xsl:choose>
377 </xsl:template>
378
379 <xsl:template name="secondLevelDescriptionElements">
380 <fo:block text-align="justify" margin-bottom="5mm">
381 <!--fo:external-graphic src='http://lully.snv.jussieu.fr/xper2AppletThumbnailsMaker/sdd/images/ant_anatomy2.jpg'/-->
382 <xsl:for-each select="feature">
383
384 <xsl:variable name="representation" select="representation_L10n"/>
385 <xsl:if test="not(starts-with($representation, 'Material'))">
386 <xsl:if test="not(starts-with($representation, 'Figures'))">
387 <fo:inline keep-with-next.within-line="always">
388
389 <fo:inline text-decoration="underline" keep-with-next.within-line="always">
390 <xsl:value-of select="representation_L10n"/>
391 </fo:inline>
392 <fo:inline>: </fo:inline>
393 <xsl:for-each select="descriptionelements/descriptionelement">
394
395 <xsl:variable name="desc_element_text" select="multilanguageText_L10n/text"/>
396
397 <!-- filter out repeated description element text. Lorna - could do this in the CDM so it doesn't occur in the XML but not sure why it's happening-->
398 <xsl:variable name="prev_desc_element_text" select="preceding-sibling::descriptionelement[1]/multilanguageText_L10n/text"/>
399
400 <fo:inline font-size="9pt" space-after="5mm">
401
402 <xsl:if test="not(starts-with($desc_element_text, 'Figure'))">
403
404 <xsl:choose>
405 <xsl:when test="position() = 1">
406 <xsl:apply-templates select="multilanguageText_L10n/text"/>
407 </xsl:when>
408 <xsl:otherwise>
409 <xsl:if test="$desc_element_text != $prev_desc_element_text">
410 <xsl:apply-templates select="multilanguageText_L10n/text"/>
411 </xsl:if>
412 </xsl:otherwise>
413 </xsl:choose>
414
415 </xsl:if>
416 </fo:inline>
417
418 <!--xsl:apply-templates select="multilanguageText_L10n/text"/-->
419 <!--xsl:apply-templates select="media"/-->
420
421 <!--TODO Lorna we have to apply either one or the other depending on the species
422 need to find out why the images occur in different places in the XML -->
423 <xsl:apply-templates select="media/e/representations/e/parts/e/uri"/>
424 <!--xsl:apply-templates select="e[1]/name[1]/homotypicalGroup[1]/typifiedNames[1]/e/taxonBases[1]/e/descriptions[1]/e/elements[1]/e[1]/media[1]/e/representations[1]/e/parts[1]/e/uri"></xsl:apply-templates-->
425
426 </xsl:for-each>
427
428 <xsl:text> </xsl:text>
429 </fo:inline>
430 </xsl:if>
431 </xsl:if>
432 </xsl:for-each>
433
434
435 <xsl:apply-templates select="../../../../../../../../../synonymy[1]/homotypicSynonymsByHomotypicGroup[1]/e[1]/name[1]/homotypicalGroup[1]/typifiedNames[1]/e/taxonBases[1]/e/descriptions[1]/e/elements[1]/e[1]/media[1]/e/representations[1]/e/parts[1]/e/uri"></xsl:apply-templates>
436
437 </fo:block>
438
439 </xsl:template>
440
441 <!-- IMAGES -->
442
443 <!--xsl:template match="media"-->
444 <xsl:template match="uriprob">
445 <fo:block>
446 <xsl:variable name="graphic" select="."/>
447 <fo:external-graphic content-height="450%" scaling="uniform" src="{$graphic}" padding-before="100" padding-after="30"/>
448 <!--xsl:apply-templates select="../multilanguageText_L10n/text"/-->
449 <fo:inline font-size="{$taxon-name-size-font}">
450 <xsl:apply-templates select="../../../../../../../multilanguageText_L10n/text"/>
451 </fo:inline>
452 </fo:block>
453 </xsl:template>
454
455 <xsl:template match="uri">
456 <!--fo:block text-align="center"-->
457 <fo:block keep-with-next="always" text-align="center">
458 <!--fo:inline text-align="center"-->
459 <!--xsl:variable name="graphic" select="e/representations/e/parts/e/uri"/-->
460 <xsl:variable name="graphic" select="."/>
461
462 <fo:external-graphic content-height="scale-to-fit" height="{$graphic-height}" scaling="uniform" src="{$graphic}" padding-before="30" padding-after="2" display-align="center"/>
463 <!--/fo:inline-->
464 </fo:block>
465 <fo:block>
466 <fo:leader leader-pattern="rule" leader-alignment="{$taxon-page-inner-margin}" rule-thickness="0.8pt" leader-length="114mm" ></fo:leader>
467 </fo:block>
468 <fo:block>
469
470 <!--fo:leader leader-pattern="rule" leader-length="120mm"/-->
471 <fo:inline font-size="8pt">
472 <xsl:apply-templates select="../../../../../../../multilanguageText_L10n/text"/>
473 </fo:inline>
474 </fo:block>
475 </xsl:template>
476
477 <xsl:template match="urilorna">
478 <fo:block>
479 <fo:inline font-size="{$taxon-name-size-font}">
480 <xsl:apply-templates select="../../../../../../../multilanguageText_L10n/text"/>
481 </fo:inline>
482 </fo:block>
483 </xsl:template>
484
485 <xsl:template match="text">
486 <!--fo:block font-size="9pt" space-after="5mm" -->
487 <!--xsl:apply-templates select="node()"/-->
488 <xsl:call-template name="add-italics">
489 <xsl:with-param name="str" select="."/>
490 </xsl:call-template>
491 <!--/fo:block -->
492 </xsl:template>
493
494 <xsl:template name="add-italics">
495 <xsl:param name="str"/>
496 <xsl:choose>
497 <xsl:when test='contains($str,"&lt;i&gt;")'>
498 <xsl:variable name="before-first-i"
499 select='substring-before($str,"&lt;i&gt;")'/>
500 <xsl:variable name="inside-first-i"
501 select="substring-before(substring-after
502 ($str,'&lt;i&gt;'),'&lt;/i&gt;')"/>
503 <xsl:variable name="after-first-i"
504 select='substring-after($str,"&lt;/i&gt;")'/>
505 <xsl:choose>
506 <xsl:when test="contains($before-first-i, '#x2014;')">
507 <xsl:call-template name="replace-mdash-html">
508 <xsl:with-param name="value" select="$before-first-i"/>
509 </xsl:call-template>
510 </xsl:when>
511 <xsl:otherwise><xsl:value-of select="$before-first-i"/></xsl:otherwise>
512 </xsl:choose>
513 <fo:inline font-style="italic"><xsl:value-of select="$inside-first-i"/></fo:inline>
514 <xsl:call-template name="add-italics">
515 <xsl:with-param name="str" select="$after-first-i"/>
516 </xsl:call-template>
517 </xsl:when>
518 <xsl:otherwise>
519 <xsl:choose>
520 <xsl:when test="contains($str, '#x2014;')">
521 <xsl:call-template name="replace-mdash-html">
522 <xsl:with-param name="value" select="$str"/>
523 </xsl:call-template>
524 </xsl:when>
525 <xsl:otherwise><xsl:value-of select="$str"/></xsl:otherwise>
526 </xsl:choose>
527 </xsl:otherwise>
528 </xsl:choose>
529 </xsl:template>
530
531 <xsl:template name="replace-mdash-html">
532 <xsl:param name="value"/>
533 <xsl:value-of select="concat(substring-before($value, '&amp;#x2014;'), '&mdash;', substring-after($value, '&amp;#x2014;'))"/>
534 </xsl:template>
535
536 <xsl:template name="remove_ampersands">
537 <xsl:param name="str"/>
538 <xsl:choose>
539 <xsl:when test='contains($str,"amp;")'>
540 </xsl:when>
541 </xsl:choose>
542 </xsl:template>
543
544 <xsl:template name="remove">
545 <xsl:param name="value"/>
546 <xsl:value-of select="concat(substring-before($value, 'amp;'), substring-after($value, 'amp;'))"/>
547 </xsl:template>
548
549 <!--xsl:template match="i">
550 <fo:inline font-style="italic">
551 <xsl:apply-templates select="node()"/>
552 </fo:inline>
553 </xsl:template-->
554
555 <xsl:template match="i">
556 <fo:inline font-style="italic"><xsl:apply-templates/></fo:inline>
557 </xsl:template>
558
559 <xsl:template match="i//text()">
560 <fo:inline font-style="italic"><xsl:apply-templates/></fo:inline>
561 </xsl:template>
562
563
564 <xsl:template name="commonTaxonName">
565 <fo:inline font-weight="bold">
566 <xsl:value-of select="representation_L10n"/>
567 </fo:inline>
568 <xsl:text> – </xsl:text>
569 <xsl:for-each select="descriptionelements/descriptionelement">
570 <fo:inline>
571 <xsl:value-of select="name"/> (<xsl:value-of
572 select="language/representation_L10n"/>), </fo:inline>
573 </xsl:for-each>
574 </xsl:template>
575
576 <xsl:template name="textData">
577 <fo:block text-align="justify" margin-bottom="5mm">
578 <!-- show all feature headlines except "ditribution" -->
579 <!--xsl:if test="uuid!='9fc9d10c-ba50-49ee-b174-ce83fc3f80c6'">
580 <fo:inline font-weight="bold">
581 <xsl:value-of select="representation_L10n"/>
582 </fo:inline>
583 <xsl:text> – </xsl:text>
584 </xsl:if-->
585 <xsl:choose>
586 <xsl:when test="uuid!='9fc9d10c-ba50-49ee-b174-ce83fc3f80c6'">
587 <fo:inline font-weight="bold">
588 <xsl:value-of select="representation_L10n"/>
589 </fo:inline>
590 <xsl:text> &mdash; </xsl:text>
591 </xsl:when>
592 <xsl:otherwise>
593 <fo:inline font-weight="bold">
594 <xsl:text> Matériel examiné </xsl:text>
595 </fo:inline>
596 </xsl:otherwise>
597
598 </xsl:choose>
599 <xsl:for-each select="descriptionelements/descriptionelement">
600 <fo:inline>
601 <xsl:apply-templates select="multilanguageText_L10n/text"/>
602 <!--xsl:value-of
603 select="multilanguageText_L10n/text" disable-output-escaping = "yes"/-->
604 </fo:inline>
605 </xsl:for-each>
606 </fo:block>
607 </xsl:template>
608
609
610 <!-- SYNONYMY BLOCK -->
611
612 <xsl:template match="synonymy" name="synonymy">
613 <fo:block margin-bottom="5mm" line-height="{$taxon-name-line-height}" font-size="{$taxon-name-size-font}">
614 <fo:block text-align="justify"
615 text-indent="-{$taxon-name-indentation}" start-indent="{$taxon-name-indentation}">
616 <xsl:apply-templates select="../name"/>
617 <!--xsl:call-template name="citations"/-->
618 <xsl:call-template name="citations">
619 <xsl:with-param name="descriptionelements" select="../descriptions/features/feature[uuid='99b2842f-9aa7-42fa-bd5f-7285311e0101']/descriptionelements"/>
620 <xsl:with-param name="name-uuid" select="../name/uuid"/>
621 </xsl:call-template>
622 <xsl:text>.</xsl:text>
623 <xsl:apply-templates select="homotypicSynonymsByHomotypicGroup"/>
624 <xsl:apply-templates select="../name/typeDesignations"/>
625 </fo:block>
626 <xsl:apply-templates select="heterotypicSynonymyGroups"/>
627 </fo:block>
628 </xsl:template>
629
630 <xsl:template match="homotypicSynonymsByHomotypicGroup">
631 <xsl:for-each select="e">
632 <xsl:text> - </xsl:text>
633 <xsl:apply-templates select="name"/>
634 <xsl:call-template name="citations">
635 <!--LORNA Pass the description elements for the citation 99b2842f-9aa7-42fa-bd5f-7285311e0101 -->
636 <xsl:with-param name="descriptionelements" select="../../../descriptions/features/feature[uuid='99b2842f-9aa7-42fa-bd5f-7285311e0101']/descriptionelements"/>
637 <xsl:with-param name="name-uuid" select="name/uuid"/>
638 </xsl:call-template>
639 </xsl:for-each>
640
641 <!--xsl:apply-templates select="e[1]/name[1]/homotypicalGroup[1]/typifiedNames[1]/e/taxonBases[1]/e/descriptions[1]/e/elements[1]/e[1]/media[1]/e/representations[1]/e/parts[1]/e/uri"></xsl:apply-templates-->
642 </xsl:template>
643
644 <xsl:template match="heterotypicSynonymyGroups">
645 <xsl:for-each select="e">
646 <fo:block text-align="start"
647 text-indent="-{$taxon-name-indentation}" start-indent="{$taxon-name-indentation}">
648 <xsl:for-each select="e">
649 <xsl:apply-templates select="name"/>
650 <xsl:call-template name="citations">
651 <xsl:with-param name="descriptionelements" select="../../../../descriptions/features/feature[uuid='99b2842f-9aa7-42fa-bd5f-7285311e0101']/descriptionelements"/>
652 <xsl:with-param name="name-uuid" select="name/uuid"/>
653 </xsl:call-template>
654 <xsl:apply-templates select="name/typeDesignations" />
655 </xsl:for-each>
656 <!--xsl:apply-templates select="e[1]/name/typeDesignations" /-->
657 </fo:block>
658 </xsl:for-each>
659 </xsl:template>
660
661 <xsl:template name="citations">
662 <xsl:param name="name-uuid"/>
663 <xsl:param name="descriptionelements" />
664 <!--xsl:for-each
665 select="../descriptions/features/feature[uuid='99b2842f-9aa7-42fa-bd5f-7285311e0101']/descriptionelements/descriptionelement"-->
666 <xsl:for-each
667 select="$descriptionelements/descriptionelement">
668 <!-- TODO sorting only works for the first citation, implement correctly -->
669 <xsl:sort select="sources/e[1]/citation/datePublished/start"/>
670 <xsl:for-each select="sources/e">
671 <xsl:if test="nameUsedInSource/uuid=$name-uuid">
672 <xsl:text>; </xsl:text>
673 <fo:inline>
674 <!--xsl:value-of select="citation/authorTeam/titleCache"/-->
675 <xsl:for-each select="citation/authorTeam/teamMembers/e">
676 <xsl:value-of select="lastname"/>
677 <xsl:choose>
678 <xsl:when test="position() != last()"><xsl:text> &amp; </xsl:text></xsl:when>
679 </xsl:choose>
680 </xsl:for-each>
681
682 <xsl:value-of select="citation/authorTeam/lastname"/>
683 <xsl:text> (</xsl:text>
684 <xsl:value-of select="citation/datePublished/start"/>
685 <xsl:text>: </xsl:text>
686 <xsl:value-of select="citationMicroReference"/>
687 <xsl:text>)</xsl:text>
688 </fo:inline>
689 </xsl:if>
690 </xsl:for-each>
691 </xsl:for-each>
692 </xsl:template>
693
694 <xsl:template match="typeDesignations">
695 <xsl:for-each select="child::*">
696 <fo:inline>
697 <xsl:text> - Type: </xsl:text>
698 <xsl:choose>
699 <xsl:when test="class='SpecimenTypeDesignation'">
700 <xsl:value-of select="typeSpecimen/titleCache"/>
701 </xsl:when>
702 </xsl:choose>
703 </fo:inline>
704 </xsl:for-each>
705 </xsl:template>
706
707 </xsl:stylesheet>