-
Notifications
You must be signed in to change notification settings - Fork 0
/
birdsbyfamily.xsl
36 lines (36 loc) · 1.98 KB
/
birdsbyfamily.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?xml version="1.0" encoding="utf-8"?><!-- MIT License Copyright (c) 2020 Rory Jaffe. -->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="utf-8" omit-xml-declaration="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<xsl:text>[IOC World Birds by Family v</xsl:text>
<xsl:value-of select="ioclist/@version"/>
<xsl:text> </xsl:text>
<xsl:value-of select="ioclist/@year"/>
<xsl:text>]
	{animals}
	{birds}
	{Aves}
	{Chordata}
	{Animalia}
	{Eumaniraptora}
	{Tetrapoda}
	{Avilalae}
	{Neornithes}
</xsl:text>
<xsl:for-each select="ioclist/list/order/family">
<xsl:text>	</xsl:text>
<xsl:value-of select="translate(english_name,',','')"/>
<xsl:text>
		{</xsl:text>
<xsl:value-of select="latin_name"/>
<xsl:text>}
</xsl:text>
<xsl:text>		{</xsl:text>
<xsl:value-of select="substring(../latin_name,1,1)"/>
<xsl:value-of select="lower-case(substring(../latin_name,2))"/>
<xsl:text>}
</xsl:text>
<xsl:value-of select="if(matches(../latin_name,'^Apterygiformes|^Casuariiformes|^Rheiformes|^Struthioniformes|^Tinamiformes','i')) then '		{Palaeognathae}
' else '		{Neognathae}
'" />
<xsl:for-each select="genus">
<xsl:for-each select="species">
<xsl:text>		</xsl:text>
<xsl:value-of select="english_name"/>
<xsl:text>
			{</xsl:text>
<xsl:value-of select="../latin_name"/>
<xsl:text> </xsl:text>
<xsl:value-of select="latin_name"/>
<xsl:value-of select="translate(@extinct,'yes','†')"/>
<xsl:text>}
</xsl:text>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>