-
Notifications
You must be signed in to change notification settings - Fork 0
/
select-taxon-name.xsl
42 lines (34 loc) · 1.11 KB
/
select-taxon-name.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
37
38
39
40
41
42
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Purpose: to extract taxon names from TaxPub documents
David King <[email protected]>
The Open University, July 2012
For the ViBRANT project, <http://vbrant.eu>
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tp="http://www.plazi.org/taxpub">
<xsl:output method="text" indent="no" encoding="UTF-8"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<xsl:apply-templates select="//tp:taxon-name">
</xsl:apply-templates>
</xsl:template>
<xsl:template match="tp:taxon-name">
<xsl:choose>
<!-- inline mark up of text -->
<xsl:when test="./text() != ''">
<xsl:text>taxon-name	</xsl:text>
<xsl:value-of select="./text()"/>
<xsl:text> </xsl:text>
</xsl:when>
<!-- in-depth mark up of text -->
<xsl:otherwise>
<xsl:for-each select="./tp:taxon-name-part">
<xsl:value-of select="./@taxon-name-part-type"/>
<xsl:text>	</xsl:text>
<xsl:value-of select="./text()"/>
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>