-
Notifications
You must be signed in to change notification settings - Fork 0
/
p.xsl
executable file
·39 lines (35 loc) · 1.19 KB
/
p.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
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method='text' encoding='UTF-8'/>
<xsl:template match="/">
<xsl:value-of select="//StripName"/>
<xsl:text>:</xsl:text>
<xsl:variable name="min">
<xsl:call-template name='min'>
<xsl:with-param name='n' select='//nota/@t'/>
<xsl:with-param name='v' select='10000'/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$min"/>
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template name="min">
<xsl:param name='n'/>
<xsl:param name='v'/>
<xsl:choose>
<xsl:when test='$n[2]'>
<xsl:call-template name='min'>
<xsl:with-param name='n' select='$n[position() > 1]'/>
<xsl:with-param name='v'>
<xsl:choose>
<xsl:when test='($n[2] -$n[1]) < $v and ($n[2] - $n[1]) > 0.1'>
<xsl:value-of select="$n[2] - $n[1]"/>
</xsl:when>
<xsl:otherwise><xsl:value-of select="$v"/></xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise><xsl:value-of select="$v"/></xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>