-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwanbot-charts-url.xsl
executable file
·30 lines (25 loc) · 1.21 KB
/
wanbot-charts-url.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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
<xsl:strip-space elements="*"/>
<xsl:template match="/thewan">http://chart.apis.google.com/chart?cht=p3&chs=500x220&chco=FF0000,FF8040,FFFF00,00FF00,00FFFF,0000FF,800080&chd=t:<xsl:apply-templates select="/thewan/points" /></xsl:template>
<xsl:template match="/thewan/points">
<xsl:call-template name="names" />
<xsl:text>&chl=</xsl:text>
<xsl:call-template name="points" />
</xsl:template>
<xsl:template name="names">
<xsl:for-each select="peep">
<xsl:sort select="@points" data-type="number" order="descending"/>
<xsl:value-of select="@points" />
<xsl:if test="not(position()=last())">,</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template name="points">
<xsl:for-each select="peep">
<xsl:sort select="@points" data-type="number" order="descending"/>
<xsl:value-of select="@name" />
<xsl:if test="not(position()=last())">|</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>