| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
|---|
| 2 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:loop="http://informatik.hu-berlin.de/loop"> |
|---|
| 3 |
<xsl:output method="xml"/> |
|---|
| 4 |
|
|---|
| 5 |
<xsl:template match="/response"> |
|---|
| 6 |
<xsl:variable name="year"> |
|---|
| 7 |
<xsl:value-of select="substring(/response/week[1]/@key, 1, 4)"/> |
|---|
| 8 |
</xsl:variable> |
|---|
| 9 |
<xsl:variable name="max_contracts"> |
|---|
| 10 |
<xsl:for-each select="week"> |
|---|
| 11 |
<xsl:sort select="@contracts" data-type="number" order="descending"/> |
|---|
| 12 |
<xsl:if test="position()=1"><xsl:value-of select="@contracts"/></xsl:if> |
|---|
| 13 |
</xsl:for-each> |
|---|
| 14 |
</xsl:variable> |
|---|
| 15 |
<graphData> |
|---|
| 16 |
<sets> |
|---|
| 17 |
<set title="Contracts" marker-type="triangle" color="green"> |
|---|
| 18 |
<xsl:for-each select="week"> |
|---|
| 19 |
<measure> |
|---|
| 20 |
<xvalue><xsl:value-of select="@week-first-yday"/></xvalue> |
|---|
| 21 |
<yvalue><xsl:value-of select="@contracts"/></yvalue> |
|---|
| 22 |
</measure> |
|---|
| 23 |
</xsl:for-each> |
|---|
| 24 |
</set> |
|---|
| 25 |
</sets> |
|---|
| 26 |
<minx>1</minx> |
|---|
| 27 |
<maxx>365</maxx> |
|---|
| 28 |
<miny>0</miny> |
|---|
| 29 |
<maxy><xsl:value-of select="$max_contracts"/></maxy> |
|---|
| 30 |
<title>Contracts by week for year <xsl:value-of select="$year"/></title> |
|---|
| 31 |
<xvalues> |
|---|
| 32 |
<xsl:for-each select="month"> |
|---|
| 33 |
<xvalue> |
|---|
| 34 |
<value><xsl:value-of select="@start-yday"/></value> |
|---|
| 35 |
<label><xsl:value-of select="@name"/></label> |
|---|
| 36 |
<gridline>true</gridline> |
|---|
| 37 |
</xvalue> |
|---|
| 38 |
</xsl:for-each> |
|---|
| 39 |
</xvalues> |
|---|
| 40 |
<yvalues> |
|---|
| 41 |
<loop:for name="i" from="20" to="$max_contracts" step="20"> |
|---|
| 42 |
<yvalue> |
|---|
| 43 |
<value><xsl:value-of select="$i"/></value> |
|---|
| 44 |
<label><xsl:value-of select="$i"/></label> |
|---|
| 45 |
<gridline>true</gridline> |
|---|
| 46 |
</yvalue> |
|---|
| 47 |
</loop:for> |
|---|
| 48 |
</yvalues> |
|---|
| 49 |
</graphData> |
|---|
| 50 |
</xsl:template> |
|---|
| 51 |
</xsl:stylesheet> |
|---|