1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE xsl:stylesheet [<!ENTITY mdash "—" > <!ENTITY ndash "–" > <!ENTITY ndash "✕" >]>
7 Target Format: Flore d'Afrique Centrale
10 <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="http://exslt.org/common"
11 xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
13 <xsl:param name="abstract"/>
14 <xsl:param name="title"/>
17 <!-- ############### Constants and definitions ################### -->
19 <!-- **********************************
21 *********************************** -->
22 <xsl:param name="global-family-font">Times</xsl:param>
23 <xsl:param name="global-size-font">10pt</xsl:param>
24 <xsl:param name="global-title-font">10pt</xsl:param>
25 <xsl:param name="global-line-height">12pt</xsl:param>
27 <xsl:param name="global-width-page">159mm</xsl:param>
28 <xsl:param name="global-height-page">244mm</xsl:param>
30 <xsl:param name="global-indentation">0mm</xsl:param>
32 <!-- **********************************
33 ** definitions for taxon pages
34 *********************************** -->
35 <xsl:param name="taxon-first-page-top-margin">30mm</xsl:param>
36 <xsl:param name="taxon-page-top-margin">32mm</xsl:param>
37 <xsl:param name="taxon-page-inner-margin">21mm</xsl:param>
38 <xsl:param name="taxon-page-bottom-margin">32mm</xsl:param>
39 <xsl:param name="graphic-height">150mm</xsl:param>
41 <xsl:param name="taxon-region-body-outer-margin">24mm</xsl:param>
43 <xsl:param name="taxon-region-before-extent">0mm</xsl:param>
44 <xsl:param name="taxon-region-after-extent">0mm</xsl:param>
46 <xsl:param name="content-bg-color">white</xsl:param>
47 <xsl:param name="taxon-header-family-font">Times</xsl:param>
48 <xsl:param name="taxon-header-before-bg-color">white</xsl:param>
49 <xsl:param name="taxon-header-after-bg-color">white</xsl:param>
50 <xsl:param name="taxon-header-size-font">7pt</xsl:param>
52 <xsl:param name="distribution-size-font">8pt</xsl:param>
54 <xsl:param name="taxon-name-indentation">4mm</xsl:param>
55 <xsl:param name="taxon-name-size-font">8pt</xsl:param>
56 <xsl:param name="taxon-name-line-height">9.6pt</xsl:param>
58 <xsl:param name="taxon-header-style-font">italic</xsl:param>
59 <xsl:param name="taxon-header-page-number-size-font">10pt</xsl:param>
60 <xsl:param name="taxon-header-page-number-align-text">end</xsl:param>
61 <xsl:param name="taxon-header-page-number-margin">11mm</xsl:param>
63 <xsl:param name="taxon-page-number-initial">1</xsl:param>
65 <!-- hardcoded ranks -->
66 <xsl:param name="uuidFamily">af5f2481-3192-403f-ae65-7c957a0f02b6</xsl:param>
67 <xsl:param name="uuidGenus">1b11c34c-48a8-4efa-98d5-84f7f66ef43a</xsl:param>
68 <xsl:param name="uuidSubgenus">78786e16-2a70-48af-a608-494023b91904</xsl:param>
71 <!-- **********************************
73 *********************************** -->
75 <!-- format html i tags in text as italic -->
76 <!--xsl:template match="i">
77 <fo:inline font-style="italic">
78 <xsl:value-of select="."/>
82 <!-- format html b tags in text as bold -->
83 <xsl:template match="b">
84 <fo:inline font-weight="bold">
85 <xsl:apply-templates/>
89 <!-- ########################################################################## -->
92 <!-- start xsl output -->
93 <xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="no"/>
94 <xsl:param name="versionParam" select="'1.0'"/>
96 <!-- root element: root -->
97 <xsl:template match="root">
98 <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
100 <!-- defines page layout -->
101 <fo:layout-master-set>
103 <!-- layout for odd taxon pages -->
104 <fo:simple-page-master master-name="taxon_page_first" page-height="{$global-height-page}"
105 page-width="{$global-width-page}" margin-top="{$taxon-first-page-top-margin}"
106 margin-bottom="{$taxon-page-bottom-margin}" margin-left="{$taxon-page-inner-margin}">
107 <fo:region-body margin-right="{$taxon-region-body-outer-margin}"/>
108 <fo:region-before extent="{$taxon-region-before-extent}" region-name="odd-before"/>
109 <fo:region-after extent="{$taxon-region-after-extent}" region-name="odd-after"/>
110 </fo:simple-page-master>
112 <!-- layout for odd taxon pages -->
113 <fo:simple-page-master master-name="taxon_page_odd" page-height="{$global-height-page}"
114 page-width="{$global-width-page}" margin-top="{$taxon-page-top-margin}"
115 margin-bottom="{$taxon-page-bottom-margin}" margin-left="{$taxon-page-inner-margin}">
116 <fo:region-body margin-right="{$taxon-region-body-outer-margin}"/>
117 <fo:region-before extent="{$taxon-region-before-extent}" region-name="odd-before"/>
118 <fo:region-after extent="{$taxon-region-after-extent}" region-name="odd-after"/>
119 </fo:simple-page-master>
121 <!-- layout for even taxon pages -->
122 <fo:simple-page-master master-name="taxon_page_even" page-height="{$global-height-page}"
123 page-width="{$global-width-page}" margin-top="{$taxon-page-top-margin}"
124 margin-bottom="{$taxon-page-bottom-margin}" margin-left="0"
125 margin-right="{$taxon-page-inner-margin}">
126 <fo:region-body margin-left="{$taxon-region-body-outer-margin}"/>
127 <fo:region-before extent="{$taxon-region-before-extent}" region-name="even-before"/>
128 <fo:region-after extent="{$taxon-region-after-extent}" region-name="even-after"/>
130 <!--fo:leader leader-pattern="rule" leader-length="10mm"/-->
132 </fo:simple-page-master>
135 <!-- defines repeatable page-sequence for layout of taxa -->
136 <fo:page-sequence-master master-name="taxon_page">
137 <fo:repeatable-page-master-alternatives>
138 <fo:conditional-page-master-reference master-reference="taxon_page_first"
139 page-position="first"/>
140 <fo:conditional-page-master-reference master-reference="taxon_page_even"
141 page-position="rest" odd-or-even="even"/>
142 <fo:conditional-page-master-reference master-reference="taxon_page_odd"
143 page-position="rest" odd-or-even="odd"/>
144 <!-- <fo:conditional-page-master-reference master-reference="mclBoook_taxon_page_even"
145 page-position="last"/>-->
146 </fo:repeatable-page-master-alternatives>
147 </fo:page-sequence-master>
148 </fo:layout-master-set>
149 <!-- end: defines page layout -->
151 <!-- page sequence for taxon view -->
152 <fo:page-sequence master-reference="taxon_page"
153 initial-page-number="{$taxon-page-number-initial}" force-page-count="no-force">
155 <fo:static-content flow-name="odd-before">
156 <xsl:call-template name="right-extent"/>
159 <fo:static-content flow-name="even-before">
160 <xsl:call-template name="left-extent"/>
166 <fo:flow flow-name="xsl-region-body">
168 <!--fo:block><xsl:value-of select="$abstract"/></fo:block-->
170 <fo:block font-family="{$global-family-font}" font-size="{$global-size-font}"
171 line-height="{$global-line-height}" linefeed-treatment="preserve">
173 <fo:block text-align="center" font-weight="bold" font-size="global-title-font" linefeed-treatment="preserve">
174 <xsl:value-of select="$title"/>
175 <xsl:text>
</xsl:text>
176 <xsl:text>
</xsl:text>
178 <!--fo:block linefeed-treatment="preserve">
179 <fo:inline font-weight="bold"><xsl:text>Abstract. </xsl:text></fo:inline>
180 <xsl:value-of select="$abstract"/>
181 <xsl:text>
</xsl:text>
184 <xsl:for-each select="//TaxonNode">
185 <xsl:apply-templates select="."/>
188 <fo:block text-align="center" text-transform="uppercase" font-weight="bold" linefeed-treatment="preserve">
189 <xsl:text>
</xsl:text>
190 <xsl:text>REFERENCES</xsl:text>
192 <xsl:text>
</xsl:text>
193 <xsl:call-template name="References"/>
195 <fo:block text-align="center" font-weight="bold" linefeed-treatment="preserve">
196 <xsl:text>
</xsl:text>
197 <xsl:text>Noms scientifiques</xsl:text>
199 <xsl:text>
</xsl:text>
200 <xsl:call-template name="scientific-name-index"/>
207 <!-- TODO shorten this so that not repeating code for creating author in each xsl:when statement -->
208 <xsl:template name="scientific-name-index">
209 <!-- create a variable for the sorted scientific names for the index, then once sorted can select preceding to get the first occurance of
210 the genusOrUninomial in the list-->
211 <xsl:variable name="sortedcopy">
212 <xsl:for-each select="//name">
213 <xsl:sort select="genusOrUninomial" data-type="text" order="ascending"></xsl:sort>
214 <xsl:sort select="specificEpithet" data-type="text" order="ascending"></xsl:sort>
215 <xsl:copy-of select="."/>
219 <fo:block margin-bottom="5mm" text-align="justify">
220 <xsl:for-each select="$sortedcopy/*"><!-- or select="//name/genusOrUninomial-->
222 <xsl:variable name="genus" select="."/>
225 <xsl:when test="rank/uuid='af5f2481-3192-403f-ae65-7c957a0f02b6'">
226 <fo:inline font-style="italic">
227 <xsl:apply-templates select="genusOrUninomial"/>
229 <xsl:for-each select="taggedName/e">
230 <xsl:if test="type='authors'">
231 <xsl:text> </xsl:text>
232 <xsl:value-of select="text"/>
237 <xsl:when test="rank/uuid='1b11c34c-48a8-4efa-98d5-84f7f66ef43a'">
239 <fo:inline font-style="italic">
240 <xsl:apply-templates select="genusOrUninomial"/>
242 <xsl:for-each select="taggedName/e">
243 <xsl:if test="type='authors'">
244 <xsl:text> </xsl:text>
245 <xsl:value-of select="text"/>
251 <xsl:when test="rank/uuid='78786e16-2a70-48af-a608-494023b91904'">
253 <xsl:apply-templates select="rank/representation_L10n"/>
254 <xsl:text> </xsl:text>
255 <fo:inline font-style="italic">
256 <xsl:apply-templates select="genusOrUninomial"/>
258 <xsl:for-each select="taggedName/e">
259 <xsl:if test="type='authors'">
260 <xsl:text> </xsl:text>
261 <xsl:value-of select="text"/>
267 <xsl:when test="rank/uuid='b301f787-f319-4ccc-a10f-b4ed3b99a86d'">
269 <!--first occurance of the genusOrUninomial in the list is not indented -->
271 <xsl:when test="not(preceding::genusOrUninomial[1] = genusOrUninomial)">
273 <fo:inline font-style="italic">
274 <xsl:apply-templates select="genusOrUninomial"/>
275 <xsl:text> </xsl:text>
276 <xsl:apply-templates select="specificEpithet"/>
278 <xsl:text> </xsl:text>
279 <!--xsl:apply-templates select="rank/titleCache"/-->
280 <xsl:for-each select="taggedName/e">
281 <xsl:if test="type='authors'">
282 <xsl:text> </xsl:text>
283 <xsl:value-of select="text"/>
290 <fo:block text-indent="{$taxon-name-indentation}">
291 <fo:inline font-style="italic">
292 <xsl:apply-templates select="specificEpithet"/>
294 <xsl:text> </xsl:text>
295 <!--xsl:apply-templates select="rank/titleCache"/--><!-- for debugging -->
296 <xsl:for-each select="taggedName/e">
297 <xsl:if test="type='authors'">
298 <xsl:text> </xsl:text>
299 <xsl:value-of select="text"/>
308 <!-- variant d5feb6a5-af5c-45ef-9878-bb4f36aaf490-->
309 <xsl:when test="rank/uuid='d5feb6a5-af5c-45ef-9878-bb4f36aaf490'">
310 <fo:block text-indent="{$taxon-name-indentation}">
311 <xsl:text>– </xsl:text> <!--concat ndash-->
312 <xsl:apply-templates select="rank/representation_L10n_abbreviatedLabel"/>
313 <xsl:text> </xsl:text>
314 <fo:inline font-style="italic">
315 <xsl:apply-templates select="specificEpithet"/>
318 <xsl:for-each select="taggedName/e">
319 <xsl:if test="type='authors'">
320 <xsl:text> </xsl:text>
321 <xsl:value-of select="text"/>
326 <!-- sub-species 462a7819-8b00-4190-8313-88b5be81fad5-->
327 <xsl:when test="rank/uuid='462a7819-8b00-4190-8313-88b5be81fad5'">
328 <fo:block text-indent="{$taxon-name-indentation}">
329 <!--xsl:apply-templates select="specificEpithet"/--><!--remove - just for testing -->
330 <xsl:text>- </xsl:text>
331 <xsl:apply-templates select="rank/representation_L10n_abbreviatedLabel"/>
332 <xsl:text> </xsl:text>
333 <fo:inline font-style="italic">
334 <xsl:apply-templates select="infraSpecificEpithet"/>
336 <!--xsl:variable name="full-name">
337 <xsl:apply-templates select="../taggedName"/> we only want to add the authors from taggedName if taggedName/e/type='author' select text
339 <!--fo:inline font-style="bold">
340 <xsl:apply-templates select="$full-name"></xsl:apply-templates>
342 <!--xsl:apply-templates select="substring-after(' ', $full-name)"></xsl:apply-templates-->
343 <!--xsl:call-template name="dispay-author-name">
344 <xsl:with-param name="e" select="../taggedName/e"/>
345 </xsl:call-template-->
346 <xsl:for-each select="taggedName/e">
347 <xsl:if test="type='authors'">
348 <xsl:text> </xsl:text>
349 <xsl:value-of select="text"/>
355 <!-- for debugging LORNA DEBUGGING XSLT CHOOSE: <xsl:value-of
356 select="../rank/uuid"/>: <xsl:value-of select="../titleCache"/>
364 <xsl:template name="dispay-author-name"> <!-- call this template with node e - don't display uninomial for species -->
365 <xsl:param name="e"/>
366 <xsl:if test="$e/type='authors'">
367 <xsl:text>++++++</xsl:text>
368 <xsl:value-of select="$e/text"/>
374 <xsl:template name="right-extent">
375 <!--fo:block text-align="center">Page <fo:page-number/>
377 <fo:block font-family="{$taxon-header-family-font}" font-style="{$taxon-header-style-font}"
378 font-size="{$taxon-header-size-font}">
379 <!-- No pagination at the moment -->
380 <fo:block font-size="{$taxon-header-page-number-size-font}" font-style="normal"
381 padding-top="95%" text-align="end">| <fo:page-number padding-right="10%"
382 border-right-width="11mm"/></fo:block>
383 <!--text-align="{$taxon-header-page-number-align-text}"> | <fo:page-number/></fo:block> -->
384 <!--margin-right="{$taxon-region-body-outer-margin}" -->
386 <fo:block color="white">-</fo:block>
388 <fo:retrieve-marker retrieve-class-name="pageTitleMarker"
389 retrieve-position="first-starting-within-page" retrieve-boundary="document"/>
390 <xsl:text> </xsl:text>
391 <fo:retrieve-marker retrieve-class-name="pageTitleSectionMarker"
392 retrieve-position="first-starting-within-page" retrieve-boundary="document"/>
397 <xsl:template name="left-extent">
398 <fo:block font-family="{$taxon-header-family-font}" font-style="{$taxon-header-style-font}"
399 font-size="{$taxon-header-size-font}">
400 <fo:block font-size="{$taxon-header-page-number-size-font}" font-style="normal"
401 padding-top="95%" text-align="start"><fo:page-number padding-left="10%"
402 border-right-width="11mm"/> |</fo:block>
403 <!-- No pagination at the moment
404 <fo:block font-size="{$taxon-header-page-number-size-font}"
405 text-align="{$taxon-header-page-number-align-text}"> — <fo:page-number/> —
410 <!--xsl:template name="odd-after-header">
411 <fo:block font-family="{$taxon-header-family-font}" font-style="{$taxon-header-style-font}"
412 font-size="{$taxon-header-size-font}">
415 <fo:retrieve-marker retrieve-class-name="pageTitleMarker"
416 retrieve-position="last-starting-within-page" retrieve-boundary="document"/>
417 <fo:retrieve-marker retrieve-class-name="pageTitleSectionMarker"
418 retrieve-position="last-starting-within-page" retrieve-boundary="document"/>
425 <!--xsl:template name="even-before-header">
426 <fo:block font-family="{$taxon-header-family-font}" font-style="{$taxon-header-style-font}"
427 font-size="{$taxon-header-size-font}"-->
429 No pagination at the moment
430 <fo:block color="white" font-size="{$taxon-header-page-number-size-font}">-</fo:block>
431 <fo:block color="white">-</fo:block>-->
435 <fo:retrieve-marker retrieve-class-name="pageTitleMarker"
436 retrieve-position="first-starting-within-page" retrieve-boundary="document"/>
437 <fo:retrieve-marker retrieve-class-name="pageTitleSectionMarker"
438 retrieve-position="first-starting-within-page" retrieve-boundary="document"/>
445 <xsl:template name="even-after-header">
446 <fo:block font-family="{$taxon-header-family-font}" font-style="{$taxon-header-style-font}"
447 font-size="{$taxon-header-size-font}">
450 <fo:retrieve-marker retrieve-class-name="pageTitleMarker"
451 retrieve-position="last-starting-within-page" retrieve-boundary="document"/>
452 <fo:retrieve-marker retrieve-class-name="pageTitleSectionMarker"
453 retrieve-position="last-starting-within-page" retrieve-boundary="document"/>
456 <!-- No pagination at the moment
457 <fo:block color="white">-</fo:block>
458 <fo:block font-size="{$taxon-header-page-number-size-font}"
459 text-align="{$taxon-header-page-number-align-text}"> — <fo:page-number/> —
466 <xsl:template match="TaxonNode" name="TaxonNode">
467 <xsl:apply-templates select="Taxon"/>
470 <xsl:template match="Taxon" name="Taxon">
471 <!--xsl:call-template name="title"/--> <!-- sections don't have stitles as just creating a name list -->
472 <xsl:apply-templates select="synonymy"/>
473 <xsl:apply-templates select="descriptions"/>
474 <xsl:apply-templates select="key"/>
478 <xsl:template name="title">
479 <fo:block margin-bottom="5mm">
480 <!-- we need to find a way to store the uuid in a variable xsl:parameter did not work or i was using it wrong -->
483 <xsl:when test="name/rank/uuid='af5f2481-3192-403f-ae65-7c957a0f02b6'">
484 <fo:block font-weight="bold">
485 <xsl:apply-templates select="name/genusOrUninomial"/>
489 <!-- we don't show the genus as a title for the caryophyllales -->
490 <xsl:when test="name/rank/uuid='1b11c34c-48a8-4efa-98d5-84f7f66ef43a'">
492 <xsl:apply-templates select="name/genusOrUninomial"/>
496 <xsl:when test="name/rank/uuid='78786e16-2a70-48af-a608-494023b91904'">
498 <xsl:apply-templates select="name/rank/representation_L10n"/>
499 <xsl:text> </xsl:text>
500 <xsl:apply-templates select="name/genusOrUninomial"/>
504 <xsl:when test="name/rank/uuid='b301f787-f319-4ccc-a10f-b4ed3b99a86d'">
506 <xsl:apply-templates select="name/genusOrUninomial"/>
507 <xsl:text> </xsl:text>
508 <xsl:apply-templates select="name/specificEpithet"/>
512 <!-- for debugging --> <!--Unformatted title for rank uuid: <xsl:value-of
513 select="name/rank/uuid"/>: <xsl:value-of select="name/titleCache"/>-->
521 <xsl:template match="name">
523 <xsl:variable name="fontstyle">
525 <xsl:when test="rank/uuid='af5f2481-3192-403f-ae65-7c957a0f02b6'">
526 <xsl:value-of select="'bold'" />
529 <xsl:value-of select="'regular'" />
533 <fo:block font-weight="{$fontstyle}">
534 <xsl:apply-templates select="taggedName"/>
535 <xsl:apply-templates select="nomenclaturalReference"/>
539 <xsl:template match="taggedName">
540 <xsl:for-each select="e">
542 <xsl:when test="type='name'">
543 <fo:inline font-style="italic">
544 <xsl:value-of select="text"/>
546 <xsl:text> </xsl:text>
548 <xsl:when test="type='authors'">
549 <xsl:value-of select="text"/>
552 <xsl:value-of select="text"/>
553 <xsl:text> </xsl:text>
560 <!-- first date in brackets -->
561 <xsl:template match="nomenclaturalReference">
562 <xsl:text> (</xsl:text>
564 <xsl:value-of select="authorTeam/titleCache"/>
565 <xsl:text> </xsl:text>
566 <xsl:value-of select="datePublished/start"/>: </fo:inline>
567 <xsl:text> </xsl:text>
569 <xsl:value-of select="../nomenclaturalMicroReference"/>
571 <xsl:text>)</xsl:text>
574 <!-- DESCRIPTIONS -->
576 <xsl:template match="descriptions" name="descriptions">
577 <xsl:for-each select="features/feature">
579 <xsl:when test="count(feature)!=0">
580 <xsl:call-template name="secondLevelDescriptionElements"/>
583 <!-- everything except Citation -->
584 <xsl:if test="uuid!='99b2842f-9aa7-42fa-bd5f-7285311e0101'">
585 <xsl:call-template name="descriptionElements"/>
587 <!--xsl:apply-templates select="media/e/representations/e/parts/e/uri"/-->
593 <xsl:template name="descriptionElements">
595 <xsl:when test="supportsCommonTaxonName='true'">
596 <!-- for example Vernacular Name -->
597 <xsl:call-template name="commonTaxonName"/>
600 <!-- for example Habitat, Material Examined -->
601 <xsl:call-template name="textData"/>
606 <xsl:template name="secondLevelDescriptionElements">
607 <fo:block text-align="justify" margin-bottom="5mm">
608 <!--fo:external-graphic src='http://lully.snv.jussieu.fr/xper2AppletThumbnailsMaker/sdd/images/ant_anatomy2.jpg'/-->
609 <xsl:for-each select="feature">
611 <xsl:variable name="representation" select="representation_L10n"/>
612 <xsl:if test="not(starts-with($representation, 'Material'))">
613 <!--xsl:if test="not(starts-with($representation, 'Figures'))"-->
614 <fo:inline keep-with-next.within-line="always">
616 <xsl:if test="not(starts-with($representation, 'Figures'))">
617 <!-- The headings are in English - do we want to remove them altogether or have French headings -->
618 <!--fo:inline text-decoration="underline" keep-with-next.within-line="always">
620 <xsl:value-of select="representation_L10n"/>
622 <fo:inline>: </fo:inline-->
625 <xsl:for-each select="descriptionelements/descriptionelement">
627 <xsl:variable name="desc_element_text" select="multilanguageText_L10n/text"/>
629 <!-- 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-->
630 <xsl:variable name="prev_desc_element_text"
631 select="preceding-sibling::descriptionelement[1]/multilanguageText_L10n/text"/>
633 <fo:inline font-size="9pt" space-after="5mm">
635 <xsl:if test="not(starts-with($desc_element_text, 'Figure'))">
638 <xsl:when test="position() = 1">
639 <xsl:apply-templates select="multilanguageText_L10n/text"/>
642 <xsl:if test="$desc_element_text != $prev_desc_element_text">
643 <!-- checked in the tax editor and looks like only descriptionelement[1] refers to the species so don't need below-->
644 <!--xsl:apply-templates select="multilanguageText_L10n/text"/-->
653 <!--xsl:apply-templates select="multilanguageText_L10n/text"/-->
654 <!--xsl:apply-templates select="media"/-->
656 <!--TODO Lorna we need to work out which description element contains the uri node for each figure
657 and place it next to the appropriate taxon in the output-->
659 <!--xsl:if test="not(starts-with($representation, 'Figures'))"-->
660 <!--xsl:if test="position() = 1"-->
661 <!--xsl:value-of select="../../../../../../Taxon/name/titleCache"/-->
663 <!-- if it has the title map don't show it in the image section -->
665 <xsl:if test="not(starts-with(media/e/title_L10n,'Map'))">
666 <xsl:apply-templates select="media/e/representations/e/parts/e/uri"/>
672 <!--xsl:call-template name="uri">
673 <xsl:with-param name="uri-node" select="media/e/representations/e/parts/e/uri"/>
674 </xsl:call-template-->
676 <!--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-->
680 <xsl:text> </xsl:text>
692 <xsl:template match="uri">
693 <!--xsl:template name="uri"-->
695 <xsl:param name="uri-node"/>
696 <xsl:variable name="graphic" select="."/>
697 <xsl:variable name="title" select="../../../../../title_L10n"/>
698 <!--fo:block text-align="center"-->
700 <!--xsl:variable name="graphic" select="e/representations/e/parts/e/uri"/-->
702 <!-- Is there a description element of type Figure for this TaxonNode?-->
706 <!--xsl:when test="contains($graphic,'jpg')"-->
707 <xsl:when test="starts-with($title,'Map')">
708 <fo:block keep-with-next="always" text-align="center">
710 <!--fo:inline text-align="center"-->
711 <fo:external-graphic content-height="scale-to-fit" height="50mm"
712 scaling="uniform" src="{$graphic}" padding-before="30" padding-after="2"
713 display-align="center"/>
719 <fo:block keep-with-next="always" text-align="center">
721 <!--fo:inline text-align="center"-->
722 <fo:external-graphic content-height="scale-to-fit" height="{$graphic-height}"
723 scaling="uniform" src="{$graphic}" padding-before="30" padding-after="2"
724 display-align="center"/>
728 <fo:leader leader-pattern="rule" leader-alignment="{$taxon-page-inner-margin}"
729 rule-thickness="0.8pt" leader-length="114mm"/>
737 <!--fo:leader leader-pattern="rule" leader-length="120mm"/-->
738 <fo:inline font-size="{$taxon-name-size-font}">
739 <!--go back up to the description element and get the text for the Figure legend -->
740 <xsl:apply-templates select="../../../../../../../multilanguageText_L10n/text"/>
746 <xsl:template match="text">
747 <!--fo:block font-size="9pt" space-after="5mm" -->
748 <!--xsl:apply-templates select="node()"/-->
749 <!--xsl:call-template name="add-markup">
750 <xsl:with-param name="str" select="."/>
752 <xsl:with-param name="tag-name" select="b"/>
753 </xsl:call-template-->
755 <xsl:when test="contains(.,"<b>")">
756 <xsl:call-template name="add-markup">
757 <xsl:with-param name="str" select="."/>
758 <!--xsl:with-param name="tag-name" select="b"/-->
759 <xsl:with-param name="tag-name">b</xsl:with-param>
763 <xsl:call-template name="add-markup">
764 <xsl:with-param name="str" select="."/>
765 <xsl:with-param name="tag-name">i</xsl:with-param>
773 <!-- TODO Can this template be made shorter by less nesting in the xsl:choose statements -->
774 <xsl:template name="add-markup">
775 <xsl:param name="str"/>
776 <xsl:param name="tag-name"/>
778 <xsl:variable name="opening-tag">
779 <xsl:value-of select="concat('<', $tag-name, '>')"> </xsl:value-of>
781 <xsl:variable name="closing-tag">
782 <xsl:value-of select="concat('</', $tag-name, '>')"> </xsl:value-of>
786 <xsl:when test="contains($str, $opening-tag)">
787 <xsl:variable name="before-tag" select="substring-before($str, $opening-tag)"/>
788 <xsl:variable name="inside-tag"
789 select="substring-before(substring-after($str,$opening-tag),$closing-tag)"/>
790 <xsl:variable name="after-tag" select="substring-after($str, $closing-tag)"/>
792 <xsl:when test="contains($before-tag, '#x2014;')">
793 <xsl:call-template name="replace-string">
794 <xsl:with-param name="text" select="$before-tag"/>
795 <xsl:with-param name="replace" select="'&#x2014;'" />
796 <xsl:with-param name="with" select="'—'"/>
801 <xsl:when test="contains($before-tag, '#x2013;')">
802 <xsl:call-template name="replace-string">
803 <xsl:with-param name="text" select="$before-tag"/>
804 <xsl:with-param name="replace" select="'&#x2013;'" />
805 <xsl:with-param name="with" select="'–'"/>
810 <xsl:when test="contains($str, '#x2716;')">
811 <xsl:call-template name="replace-string">
812 <xsl:with-param name="text" select="$before-tag"/>
813 <xsl:with-param name="replace" select="'&#x2715;'" />
814 <xsl:with-param name="with" select="'–'"/>
818 <xsl:value-of select="$before-tag"/>
825 <!-- add BOLD or italics when inside the appropriate tags -->
827 <xsl:when test="$tag-name = 'b'">
828 <fo:inline font-weight="bold">
829 <xsl:value-of select="$inside-tag"/>
833 <fo:inline font-style="italic">
834 <xsl:value-of select="$inside-tag"/>
838 <!-- call template recursively with the remaining text after the tag -->
839 <xsl:call-template name="add-markup">
840 <xsl:with-param name="str" select="$after-tag"/>
841 <xsl:with-param name="tag-name" select="$tag-name"/>
846 <xsl:when test="contains($str, '#x2014;')">
847 <xsl:call-template name="replace-string">
848 <xsl:with-param name="text" select="$before-tag"/>
849 <xsl:with-param name="replace" select="'&#x2014;'" />
850 <xsl:with-param name="with" select="'—'"/>
855 <xsl:when test="contains($str, '#x2013;')">
856 <xsl:call-template name="replace-string">
857 <xsl:with-param name="text" select="$before-tag"/>
858 <xsl:with-param name="replace" select="'&#x2013;'" />
859 <xsl:with-param name="with" select="'–'"/>
864 <xsl:when test="contains($str, '#x2716;')">
865 <xsl:call-template name="replace-string">
866 <xsl:with-param name="text" select="$before-tag"/>
867 <xsl:with-param name="replace" select="'&#x2715;'" />
868 <xsl:with-param name="with" select="'–'"/>
872 <xsl:value-of select="$str"/>
883 <xsl:template name="replace-string">
884 <xsl:param name="text"/>
885 <xsl:param name="replace"/>
886 <xsl:param name="with"/>
888 <xsl:when test="contains($text,$replace)">
889 <xsl:value-of select="substring-before($text,$replace)"/>
890 <xsl:value-of select="$with"/>
891 <xsl:call-template name="replace-string">
892 <xsl:with-param name="text"
893 select="substring-after($text,$replace)"/>
894 <xsl:with-param name="replace" select="$replace"/>
895 <xsl:with-param name="with" select="$with"/>
899 <xsl:value-of select="$text"/>
904 <xsl:template name="remove_ampersands">
905 <xsl:param name="str"/>
907 <xsl:when test="contains($str,"amp;")"> </xsl:when>
911 <xsl:template name="remove">
912 <xsl:param name="value"/>
913 <xsl:value-of select="concat(substring-before($value, 'amp;'), substring-after($value, 'amp;'))"
917 <!--xsl:template match="i">
918 <fo:inline font-style="italic">
919 <xsl:apply-templates select="node()"/>
923 <xsl:template match="i">
924 <fo:inline font-style="italic">
925 <xsl:apply-templates/>
929 <xsl:template match="i//text()">
930 <fo:inline font-style="italic">
931 <xsl:apply-templates/>
936 <xsl:template name="commonTaxonName">
937 <fo:inline font-weight="bold">
938 <xsl:value-of select="representation_L10n"/>
940 <xsl:text> — </xsl:text>
941 <xsl:for-each select="descriptionelements/descriptionelement">
944 <xsl:when test="position() != last()">
945 <xsl:value-of select="name"/> (<xsl:value-of select="language/representation_L10n"/>), </xsl:when>
947 <xsl:value-of select="name"/> (<xsl:value-of select="language/representation_L10n"
954 <xsl:template name="commonTaxonNameold2">
955 <fo:inline font-weight="bold">
956 <xsl:value-of select="representation_L10n"/>
958 <xsl:text> — </xsl:text>
959 <xsl:for-each select="descriptionelements/descriptionelement">
961 <xsl:value-of select="name"/> (<xsl:value-of select="language/representation_L10n"/>) <xsl:choose>
962 <xsl:when test="position() != last()">,</xsl:when>
963 <xsl:otherwise>.</xsl:otherwise>
969 <xsl:template name="commonTaxonNameold">
970 <fo:inline font-weight="bold">
971 <xsl:value-of select="representation_L10n"/>
973 <xsl:text> — </xsl:text>
974 <xsl:for-each select="descriptionelements/descriptionelement">
976 <xsl:value-of select="name"/> (<xsl:value-of select="language/representation_L10n"/>),
981 <xsl:template name="textData">
982 <fo:block text-align="justify" margin-bottom="5mm">
983 <!-- show all feature headlines except "ditribution" -->
984 <!--xsl:if test="uuid!='9fc9d10c-ba50-49ee-b174-ce83fc3f80c6'">
985 <fo:inline font-weight="bold">
986 <xsl:value-of select="representation_L10n"/>
988 <xsl:text> – </xsl:text>
991 <!-- 9fc9d10c-ba50-49ee-b174-ce83fc3f80c6 is Distribution -->
992 <xsl:when test="uuid!='9fc9d10c-ba50-49ee-b174-ce83fc3f80c6'">
993 <fo:inline font-weight="bold">
994 <xsl:value-of select="representation_L10n"/>
995 <!-- e.g. Habitat -->
997 <xsl:text> — </xsl:text>
1000 <fo:inline font-weight="bold" keep-with-next="always">
1001 <xsl:text> Matériel examiné </xsl:text>
1002 <xsl:text>
</xsl:text>
1007 <!--xsl:for-each select="descriptionelements/descriptionelement">
1009 <xsl:text>LINE 609</xsl:text>
1010 <xsl:apply-templates select="multilanguageText_L10n/text"/>
1014 <!-- LORNA TRY IMAGE HERE -->
1015 <!--xsl:apply-templates select="descriptionelements/descriptionelement[1]/media/e/representations/e/parts/e/uri"/-->
1017 <xsl:apply-templates
1018 select="descriptionelements/descriptionelement[1]/multilanguageText_L10n/text"/>
1020 <!-- get the map associated with the distribution, this is temporarily stored as a media object jpg created by
1021 Quentin's GIS software -->
1022 <xsl:if test="uuid='9fc9d10c-ba50-49ee-b174-ce83fc3f80c6'">
1024 <!-- get the map attached to the feature 'Figures' -->
1025 <xsl:apply-templates
1026 select="../feature/feature/representation_L10n[.='Figures']/../descriptionelements/descriptionelement[1]/media/e/representations/e/parts/e/uri"/>
1027 <!--media/e/representations/e/parts/e/uri media/e/title_L10n[.='Map']/../representations/e/parts/e/uri"/-->
1033 <xsl:template match="key" name="key">
1034 <!--fo:block margin-bottom="5mm" line-height="{$taxon-name-line-height}" font-size="{$taxon-name-size-font}"-->
1035 <fo:block linefeed-treatment="preserve">
1037 <fo:block font-weight="bold" text-align="center">
1038 <xsl:value-of select="HashMap/titleCache"/>
1040 <xsl:if test="HashMap/records/e">
1041 <xsl:text>
</xsl:text>
1043 <fo:table-column column-width="5mm"/>
1044 <fo:table-column column-width="5mm"/>
1045 <fo:table-column column-width="69mm"/>
1046 <fo:table-column column-width="36mm"/>
1048 <!--xsl:if test="ArrayList/e"-->
1049 <xsl:for-each select="HashMap/records/e">
1051 <!-- TaxonLinkDto or PolytomousKeyNodeLinkDto-->
1055 <xsl:if test="edgeNumber = 1">
1056 <xsl:value-of select="nodeNumber"/>
1057 <xsl:text>.</xsl:text>
1062 <fo:block>–</fo:block>
1066 <xsl:apply-templates select="childStatement"/-->
1067 <!--xsl:value-of select="concat(childStatement, '..............')"/-->
1068 <!--xsl:text>.......................................................................................</xsl:text>
1070 <fo:block text-align="justify" text-align-last="justify">
1071 <!-- leader-length="auto"-->
1072 <xsl:value-of select="childStatement"/>
1073 <xsl:text> </xsl:text>
1074 <fo:leader leader-pattern="dots"/>
1078 <fo:table-cell display-align="after">
1079 <fo:block font-style="italic" text-align="justify" text-align-last="justify">
1080 <!-- leader-length="auto" text-align="right"-->
1081 <fo:leader leader-pattern="dots"/>
1083 <xsl:when test="links/e[1]/class = 'PolytomousKeyNodeLinkDto'">
1084 <xsl:value-of select="links/e[1]/nodeNumber"/>
1086 <xsl:when test="links/e[1]/class = 'TaxonLinkDto'">
1087 <xsl:variable name="taxonUuid" select="links/e[1]/uuid"/>
1088 <xsl:variable name="genus"
1089 select="//Taxon/uuid[.=$taxonUuid]/../name/genusOrUninomial"/>
1091 <xsl:when test="taxonUuid = $uuidSubgenus">
1092 <xsl:variable name="repr"
1093 select="//Taxon/uuid[.='71cd0e8d-47eb-4c66-829a-e21c705ee660']/../name/rank/representation_L10n"/>
1094 <!--xsl:value-of select="concat($substring($genus,1,1), '. ', $repr)"/-->
1095 <xsl:value-of select="concat($genus, '. ', $repr)"/>
1097 <xsl:when test="taxonUuid = $uuidGenus">
1098 <fo:block font-weight="bold" text-align="center"
1099 text-transform="uppercase">
1100 <xsl:apply-templates select="$genus"/>
1104 <xsl:variable name="specificEpithet"
1105 select="//Taxon/uuid[.=$taxonUuid]/../name/specificEpithet"/>
1106 <!-- abbreviate the genus for species names -->
1107 <!--xsl:value-of select="concat(substring($genus,1,1), '. ', $specificEpithet)"/-->
1108 <xsl:value-of select="concat($genus, '. ', $specificEpithet)"/>
1121 <fo:leader leader-pattern="rule" leader-length="100%"/>
1122 <xsl:text>
</xsl:text>
1124 <!-- new line for the end of the section -->
1125 <xsl:text>
</xsl:text>
1130 <!-- SYNONYMY BLOCK -->
1132 <xsl:template match="synonymy" name="synonymy">
1133 <!--fo:block margin-bottom="5mm" line-height="{$taxon-name-line-height}"
1134 font-size="{$taxon-name-size-font}"-->
1135 <fo:block text-align="justify" text-indent="-{$taxon-name-indentation}"
1136 start-indent="{$taxon-name-indentation}">
1137 <xsl:apply-templates select="../name"/>
1138 <!--xsl:call-template name="citations"/-->
1139 <!-- 99b2842f-9aa7-42fa-bd5f-7285311e0101 is Citation -->
1140 <xsl:call-template name="citations">
1141 <xsl:with-param name="descriptionelements"
1142 select="../descriptions/features/feature[uuid='99b2842f-9aa7-42fa-bd5f-7285311e0101']/descriptionelements"/>
1143 <xsl:with-param name="name-uuid" select="../name/uuid"/>
1144 </xsl:call-template>
1145 <!--xsl:text>.**********</xsl:text-->
1146 <xsl:apply-templates select="homotypicSynonymsByHomotypicGroup"/>
1147 <xsl:apply-templates select="../name/typeDesignations"/>
1149 <xsl:apply-templates select="heterotypicSynonymyGroups"/>
1153 <xsl:template match="homotypicSynonymsByHomotypicGroup">
1154 <xsl:for-each select="e">
1155 <xsl:text> - </xsl:text>
1156 <xsl:apply-templates select="name"/>
1157 <xsl:call-template name="citations">
1158 <!--LORNA Pass the description elements for the citation 99b2842f-9aa7-42fa-bd5f-7285311e0101 -->
1159 <xsl:with-param name="descriptionelements"
1160 select="../../../descriptions/features/feature[uuid='99b2842f-9aa7-42fa-bd5f-7285311e0101']/descriptionelements"/>
1161 <xsl:with-param name="name-uuid" select="name/uuid"/>
1162 </xsl:call-template>
1165 <!--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-->
1168 <xsl:template match="heterotypicSynonymyGroups">
1169 <xsl:for-each select="e">
1170 <fo:block text-align="start" text-indent="-{$taxon-name-indentation}"
1171 start-indent="{$taxon-name-indentation}">
1172 <xsl:for-each select="e">
1173 <xsl:apply-templates select="name"/>
1174 <xsl:call-template name="citations">
1175 <xsl:with-param name="descriptionelements"
1176 select="../../../../descriptions/features/feature[uuid='99b2842f-9aa7-42fa-bd5f-7285311e0101']/descriptionelements"/>
1177 <xsl:with-param name="name-uuid" select="name/uuid"/>
1179 </xsl:call-template>
1180 <xsl:apply-templates select="name/typeDesignations"/>
1182 <!--xsl:apply-templates select="e[1]/name/typeDesignations" /-->
1188 <xsl:template name="citations">
1189 <xsl:param name="name-uuid"/>
1190 <xsl:param name="descriptionelements"/>
1192 select="../descriptions/features/feature[uuid='99b2842f-9aa7-42fa-bd5f-7285311e0101']/descriptionelements/descriptionelement"-->
1193 <xsl:for-each select="$descriptionelements/descriptionelement">
1194 <!-- TODO sorting only works for the first citation, implement correctly -->
1195 <xsl:sort select="sources/e[1]/citation/datePublished/start"/>
1196 <xsl:for-each select="sources/e">
1198 <xsl:variable name="lastname_text" select="citation/authorTeam/lastname"/>
1199 <xsl:variable name="prev_lastname_text" select="preceding-sibling::e[1]/citation/authorTeam/lastname"/>
1201 <xsl:if test="nameUsedInSource/uuid=$name-uuid">
1202 <xsl:text>; </xsl:text>
1204 <!--xsl:value-of select="citation/authorTeam/titleCache"/-->
1205 <!--TODO wrap this in a variable and compare the previous variable to this one to see if we're dealing with the same name-->
1206 <xsl:for-each select="citation/authorTeam/teamMembers/e">
1207 <xsl:value-of select="lastname"/>
1209 <xsl:when test="position() != last()">
1210 <xsl:text> & </xsl:text>
1216 <xsl:when test="$lastname_text != $prev_lastname_text">
1217 <xsl:value-of select="citation/authorTeam/lastname"/><!--TODO We print lastname here as well as the author list is this a mistake?-->
1219 <xsl:text> (</xsl:text>
1220 <xsl:value-of select="citation/datePublished/start"/>
1221 <xsl:text>: </xsl:text>
1222 <xsl:value-of select="citationMicroReference"/>
1223 <xsl:text>)</xsl:text>
1226 <xsl:text> </xsl:text><!-- TODO For the first ref with a particlar name we should open brackets -->
1227 <xsl:value-of select="citation/datePublished/start"/>
1228 <xsl:if test="citationMicroReference != ''">
1229 <xsl:text>: </xsl:text>
1230 <xsl:value-of select="citationMicroReference"/>
1240 <xsl:template name="citationsworks">
1241 <xsl:param name="name-uuid"/>
1242 <xsl:param name="descriptionelements"/>
1244 select="../descriptions/features/feature[uuid='99b2842f-9aa7-42fa-bd5f-7285311e0101']/descriptionelements/descriptionelement"-->
1245 <xsl:for-each select="$descriptionelements/descriptionelement">
1246 <!-- TODO sorting only works for the first citation, implement correctly -->
1247 <xsl:sort select="sources/e[1]/citation/datePublished/start"/>
1248 <xsl:for-each select="sources/e">
1250 <xsl:if test="nameUsedInSource/uuid=$name-uuid">
1251 <xsl:text>; </xsl:text>
1253 <!--xsl:value-of select="citation/authorTeam/titleCache"/-->
1254 <xsl:for-each select="citation/authorTeam/teamMembers/e">
1255 <xsl:value-of select="lastname"/>
1257 <xsl:when test="position() != last()">
1258 <xsl:text> & </xsl:text>
1263 <xsl:value-of select="citation/authorTeam/lastname"/>
1264 <xsl:text> (</xsl:text>
1265 <xsl:value-of select="citation/datePublished/start"/>
1266 <xsl:text>: </xsl:text>
1267 <xsl:value-of select="citationMicroReference"/>
1268 <xsl:text>)</xsl:text>
1276 <!-- this template is for the list of all citations at the end of the PDF -->
1277 <!-- references are under //citation and under //nomenclaturalReference and //inReference-->
1278 <!-- could try //class[.='Reference']/parent::node() to get all References -->
1279 <xsl:key name="citations-by-uuid" match="//citation | //nomenclaturalReference" use="uuid" />
1280 <!--xsl:key name="nomenclaturalrefs-by-uuid" match="//nomenclaturalReference" use="uuid" /-->
1282 <xsl:template name="References">
1283 <!-- new line for the end of the section -->
1284 <xsl:text>
</xsl:text>
1286 <!--nomenclaturalReference or citation-->
1287 <!-- problem with this is that if the same reference occurs under citaiton and under nomenclaturalReference it appears twice -->
1288 <!--xsl:for-each select="//nomenclaturalReference[count(. | key('nomenclaturalrefs-by-uuid', uuid)[1]) = 1] | //citation[count(. | key('citations-by-uuid', uuid)[1]) = 1]"-->
1290 <xsl:for-each select="//nomenclaturalReference[count(. | key('citations-by-uuid', uuid)[1]) = 1] | //citation[count(. | key('citations-by-uuid', uuid)[1]) = 1]">
1291 <!--xsl:for-each select="//nomenclaturalReference[count(. | key('nomenclaturalrefs-by-uuid', uuid)[1]) = 1]"-->
1292 <!--xsl:for-each select="//nomenclaturalReference"-->
1293 <xsl:sort select="authorTeam/lastname | authorTeam/teamMembers/e[1]/lastname" />
1294 <xsl:sort select="datePublished/start"></xsl:sort>
1296 <fo:block linefeed-treatment="preserve" text-align="justify" text-indent="-{$taxon-name-indentation}" start-indent="{$taxon-name-indentation}">
1299 <!-- filter out repeated citation uuids. Could write a controller method in the CDM to get all unique references for a TaxonNode -->
1301 <!--I am only listing references which have at least one author name. If there are other references in the database - why don't these have an author name-->
1302 <xsl:if test="authorTeam/teamMembers/e[1]/lastname != '' or authorTeam/lastname != ''">
1303 <!--xsl:text>
</xsl:text-->
1305 <xsl:when test="authorTeam/teamMembers/e[1]/lastname != ''">
1306 <xsl:for-each select="authorTeam/teamMembers/e">
1308 <xsl:value-of select="lastname"/>
1309 <xsl:text> </xsl:text>
1310 <xsl:value-of select="firstname"/>
1312 <xsl:when test="position() != last()">
1313 <xsl:text> & </xsl:text>
1319 <xsl:otherwise test="authorTeam/lastname != ''">
1321 <xsl:value-of select="authorTeam/lastname"/>
1322 <xsl:text> </xsl:text>
1323 <xsl:value-of select="authorTeam/firstname"/>
1328 <xsl:if test="datePublished/start != ''">
1329 <xsl:text> (</xsl:text>
1330 <xsl:value-of select="datePublished/start"/>
1331 <xsl:text>) </xsl:text>
1334 <xsl:apply-templates select="title"/>
1335 <xsl:apply-templates select="volume"/>
1336 <xsl:apply-templates select="pages"/>
1337 <xsl:apply-templates select="placePublished"/>
1338 <xsl:apply-templates select="publisher"/>
1340 <!-- if inReference has child nodes-->
1341 <xsl:if test="count(inReference/*) > 0">
1343 <xsl:text>In </xsl:text>
1344 <xsl:apply-templates select="inReference/title"/>
1345 <xsl:apply-templates select="inReference/volume"/>
1346 <xsl:apply-templates select="inReference/pages"/>
1347 <xsl:apply-templates select="inReference/placePublished"/>
1348 <xsl:apply-templates select="inReference/publisher"/>
1350 <!--add template match to self:: that works for the above whether it's a citation or nomenclaturalReference -->
1351 <!-- new line for the end of the section -->
1352 <xsl:text>
</xsl:text>
1359 <xsl:template match="*">
1361 <xsl:value-of select="."/>
1363 <xsl:if test="name(.) = 'title' or name(.) = 'publisher' or name(.) = 'pages'">
1364 <!-- . if pages or publisher or title - comma if placePublished -->
1365 <xsl:text>. </xsl:text>
1368 <xsl:if test="name(.) = 'volume'">
1369 <xsl:text>: </xsl:text>
1372 <xsl:if test="(../type = 'Book' or ../type = 'BookSection') and name(.) = 'placePublished' and . != ''">
1373 <xsl:text>, </xsl:text>
1380 <xsl:template name="Referencesold">
1382 <!-- need to sort by lastname of the first author i.e. //citation/authorTeam/teamMembers/e[1]/lastname -->
1383 <xsl:for-each select="//citation">
1385 <!-- TODO sorting only works for the first citation, implement correctly -->
1386 <xsl:sort select="authorTeam/lastname"/>
1387 <xsl:sort select="authorTeam/teamMembers/e[1]/lastname"/>
1391 <!-- filter out repeated citation uuids. Could write a controller method in the CDM to get all unique references for a TaxonNode -->
1392 <xsl:variable name="prev_citation_uuid" select="preceding-sibling::citation/uuid"/>
1393 <xsl:variable name="citation_uuid" select="uuid"/>
1394 <xsl:text>preceeding:</xsl:text>
1395 <xsl:value-of select="preceding-sibling::citation[1]/uuid"></xsl:value-of>
1396 <xsl:text>current:</xsl:text>
1397 <xsl:value-of select="uuid"></xsl:value-of>
1399 <!--xsl:value-of select="preceding-sibling::citation/uuid"></xsl:value-of-->
1401 <!--xsl:if test="$citation_uuid != $prev_citation_uuid"-->
1402 <xsl:if test="preceding-sibling::citation[1]/uuid != uuid">
1404 <!-- .[not(preceding-sibling::Link[@personId = current()/@personId -->
1407 <xsl:when test="authorTeam/teamMembers/e[1]/lastname != '' or authorTeam/lastname != ''">
1410 <xsl:when test="authorTeam/teamMembers/e[1]/lastname != ''">
1411 <xsl:for-each select="authorTeam/teamMembers/e">
1412 <fo:inline font-weight="bold">
1413 <xsl:value-of select="lastname"/>
1415 <xsl:when test="position() != last()">
1416 <xsl:text> & </xsl:text>
1422 <xsl:otherwise test="authorTeam/lastname != ''">
1423 <fo:inline font-weight="bold">
1424 <xsl:value-of select="authorTeam/lastname"/>
1429 <xsl:if test="datePublished/start != ''">
1430 <xsl:text> (</xsl:text>
1431 <xsl:value-of select="datePublished/start"/>
1432 <xsl:text>) </xsl:text>
1434 <xsl:value-of select="title"/>
1435 <xsl:text>.</xsl:text>
1436 <xsl:value-of select="pages"/>
1437 <xsl:text>.</xsl:text>
1439 <!-- new line for the end of the section -->
1440 <xsl:text>
</xsl:text>
1444 <xsl:text>HELLO
</xsl:text>
1452 <xsl:text>
</xsl:text>
1460 <xsl:template match="typeDesignations">
1461 <xsl:for-each select="child::*">
1465 <xsl:when test="class='SpecimenTypeDesignation'">
1466 <xsl:text> - Typus: </xsl:text>
1467 <xsl:value-of select="typeSpecimen/titleCache"/>
1469 <xsl:when test="class='NameTypeDesignation'">
1470 <xsl:text> - Typus: </xsl:text>
1471 <xsl:value-of select="typeName/titleCache"/>