Revision 986f6827
Added by Andreas Müller almost 6 years ago
cdmlib-print/src/main/resources/stylesheets/pdf/caryophyllales.xsl | ||
---|---|---|
1195 | 1195 |
<xsl:sort select="sources/e[1]/citation/datePublished/start"/> |
1196 | 1196 |
<xsl:for-each select="sources/e"> |
1197 | 1197 |
|
1198 |
<xsl:variable name="lastname_text" select="citation/authorship/lastname"/>
|
|
1199 |
<xsl:variable name="prev_lastname_text" select="preceding-sibling::e[1]/citation/authorship/lastname"/>
|
|
1198 |
<xsl:variable name="familyname_text" select="citation/authorship/familyname"/>
|
|
1199 |
<xsl:variable name="prev_familyname_text" select="preceding-sibling::e[1]/citation/authorship/familyname"/>
|
|
1200 | 1200 |
|
1201 | 1201 |
<xsl:if test="nameUsedInSource/uuid=$name-uuid"> |
1202 | 1202 |
<xsl:text>; </xsl:text> |
... | ... | |
1204 | 1204 |
<!--xsl:value-of select="citation/authorship/titleCache"/--> |
1205 | 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 | 1206 |
<xsl:for-each select="citation/authorship/teamMembers/e"> |
1207 |
<xsl:value-of select="lastname"/>
|
|
1207 |
<xsl:value-of select="familyname"/>
|
|
1208 | 1208 |
<xsl:choose> |
1209 | 1209 |
<xsl:when test="position() != last()"> |
1210 | 1210 |
<xsl:text> & </xsl:text> |
... | ... | |
1213 | 1213 |
</xsl:for-each> |
1214 | 1214 |
|
1215 | 1215 |
<xsl:choose> |
1216 |
<xsl:when test="$lastname_text != $prev_lastname_text">
|
|
1217 |
<xsl:value-of select="citation/authorship/lastname"/><!--TODO We print lastname here as well as the author list is this a mistake?-->
|
|
1216 |
<xsl:when test="$familyname_text != $prev_familyname_text">
|
|
1217 |
<xsl:value-of select="citation/authorship/familyname"/><!--TODO We print familyname here as well as the author list is this a mistake?-->
|
|
1218 | 1218 |
|
1219 | 1219 |
<xsl:text> (</xsl:text> |
1220 | 1220 |
<xsl:value-of select="citation/datePublished/start"/> |
... | ... | |
1252 | 1252 |
<fo:inline> |
1253 | 1253 |
<!--xsl:value-of select="citation/authorship/titleCache"/--> |
1254 | 1254 |
<xsl:for-each select="citation/authorship/teamMembers/e"> |
1255 |
<xsl:value-of select="lastname"/>
|
|
1255 |
<xsl:value-of select="familyname"/>
|
|
1256 | 1256 |
<xsl:choose> |
1257 | 1257 |
<xsl:when test="position() != last()"> |
1258 | 1258 |
<xsl:text> & </xsl:text> |
... | ... | |
1260 | 1260 |
</xsl:choose> |
1261 | 1261 |
</xsl:for-each> |
1262 | 1262 |
|
1263 |
<xsl:value-of select="citation/authorship/lastname"/>
|
|
1263 |
<xsl:value-of select="citation/authorship/familyname"/>
|
|
1264 | 1264 |
<xsl:text> (</xsl:text> |
1265 | 1265 |
<xsl:value-of select="citation/datePublished/start"/> |
1266 | 1266 |
<xsl:text>: </xsl:text> |
... | ... | |
1290 | 1290 |
<xsl:for-each select="//nomenclaturalReference[count(. | key('citations-by-uuid', uuid)[1]) = 1] | //citation[count(. | key('citations-by-uuid', uuid)[1]) = 1]"> |
1291 | 1291 |
<!--xsl:for-each select="//nomenclaturalReference[count(. | key('nomenclaturalrefs-by-uuid', uuid)[1]) = 1]"--> |
1292 | 1292 |
<!--xsl:for-each select="//nomenclaturalReference"--> |
1293 |
<xsl:sort select="authorship/lastname | authorship/teamMembers/e[1]/lastname" />
|
|
1293 |
<xsl:sort select="authorship/familyname | authorship/teamMembers/e[1]/familyname" />
|
|
1294 | 1294 |
<xsl:sort select="datePublished/start"></xsl:sort> |
1295 | 1295 |
|
1296 | 1296 |
<fo:block linefeed-treatment="preserve" text-align="justify" text-indent="-{$taxon-name-indentation}" start-indent="{$taxon-name-indentation}"> |
... | ... | |
1299 | 1299 |
<!-- filter out repeated citation uuids. Could write a controller method in the CDM to get all unique references for a TaxonNode --> |
1300 | 1300 |
|
1301 | 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="authorship/teamMembers/e[1]/lastname != '' or authorship/lastname != ''">
|
|
1302 |
<xsl:if test="authorship/teamMembers/e[1]/familyname != '' or authorship/familyname != ''">
|
|
1303 | 1303 |
<!--xsl:text>
</xsl:text--> |
1304 | 1304 |
<xsl:choose> |
1305 |
<xsl:when test="authorship/teamMembers/e[1]/lastname != ''">
|
|
1305 |
<xsl:when test="authorship/teamMembers/e[1]/familyname != ''">
|
|
1306 | 1306 |
<xsl:for-each select="authorship/teamMembers/e"> |
1307 | 1307 |
<fo:inline> |
1308 |
<xsl:value-of select="lastname"/>
|
|
1308 |
<xsl:value-of select="familyname"/>
|
|
1309 | 1309 |
<xsl:text> </xsl:text> |
1310 |
<xsl:value-of select="firstname"/>
|
|
1310 |
<xsl:value-of select="givenname"/>
|
|
1311 | 1311 |
<xsl:choose> |
1312 | 1312 |
<xsl:when test="position() != last()"> |
1313 | 1313 |
<xsl:text> & </xsl:text> |
... | ... | |
1316 | 1316 |
</fo:inline> |
1317 | 1317 |
</xsl:for-each> |
1318 | 1318 |
</xsl:when> |
1319 |
<xsl:otherwise test="authorship/lastname != ''">
|
|
1319 |
<xsl:otherwise test="authorship/familyname != ''">
|
|
1320 | 1320 |
<fo:inline> |
1321 |
<xsl:value-of select="authorship/lastname"/>
|
|
1321 |
<xsl:value-of select="authorship/familyname"/>
|
|
1322 | 1322 |
<xsl:text> </xsl:text> |
1323 |
<xsl:value-of select="authorship/firstname"/>
|
|
1323 |
<xsl:value-of select="authorship/givenname"/>
|
|
1324 | 1324 |
</fo:inline> |
1325 | 1325 |
</xsl:otherwise> |
1326 | 1326 |
</xsl:choose> |
... | ... | |
1379 | 1379 |
|
1380 | 1380 |
<xsl:template name="Referencesold"> |
1381 | 1381 |
|
1382 |
<!-- need to sort by lastname of the first author i.e. //citation/authorship/teamMembers/e[1]/lastname -->
|
|
1382 |
<!-- need to sort by familyname of the first author i.e. //citation/authorship/teamMembers/e[1]/familyname -->
|
|
1383 | 1383 |
<xsl:for-each select="//citation"> |
1384 | 1384 |
|
1385 | 1385 |
<!-- TODO sorting only works for the first citation, implement correctly --> |
1386 |
<xsl:sort select="authorship/lastname"/>
|
|
1387 |
<xsl:sort select="authorship/teamMembers/e[1]/lastname"/>
|
|
1386 |
<xsl:sort select="authorship/familyname"/>
|
|
1387 |
<xsl:sort select="authorship/teamMembers/e[1]/familyname"/>
|
|
1388 | 1388 |
<fo:block> |
1389 | 1389 |
<fo:inline> |
1390 | 1390 |
|
... | ... | |
1404 | 1404 |
<!-- .[not(preceding-sibling::Link[@personId = current()/@personId --> |
1405 | 1405 |
<xsl:choose> |
1406 | 1406 |
|
1407 |
<xsl:when test="authorship/teamMembers/e[1]/lastname != '' or authorship/lastname != ''">
|
|
1407 |
<xsl:when test="authorship/teamMembers/e[1]/familyname != '' or authorship/familyname != ''">
|
|
1408 | 1408 |
|
1409 | 1409 |
<xsl:choose> |
1410 |
<xsl:when test="authorship/teamMembers/e[1]/lastname != ''">
|
|
1410 |
<xsl:when test="authorship/teamMembers/e[1]/familyname != ''">
|
|
1411 | 1411 |
<xsl:for-each select="authorship/teamMembers/e"> |
1412 | 1412 |
<fo:inline font-weight="bold"> |
1413 |
<xsl:value-of select="lastname"/>
|
|
1413 |
<xsl:value-of select="familyname"/>
|
|
1414 | 1414 |
<xsl:choose> |
1415 | 1415 |
<xsl:when test="position() != last()"> |
1416 | 1416 |
<xsl:text> & </xsl:text> |
... | ... | |
1419 | 1419 |
</fo:inline> |
1420 | 1420 |
</xsl:for-each> |
1421 | 1421 |
</xsl:when> |
1422 |
<xsl:otherwise test="authorship/lastname != ''">
|
|
1422 |
<xsl:otherwise test="authorship/familyname != ''">
|
|
1423 | 1423 |
<fo:inline font-weight="bold"> |
1424 |
<xsl:value-of select="authorship/lastname"/>
|
|
1424 |
<xsl:value-of select="authorship/familyname"/>
|
|
1425 | 1425 |
</fo:inline> |
1426 | 1426 |
</xsl:otherwise> |
1427 | 1427 |
</xsl:choose> |
Also available in: Unified diff
ref #7238 rename lastName and firstName