/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output method="html" encoding="utf-8"/>

 <xsl:template match="Value">
    <tr>
	<td>
	    <xsl:element name="span">
		<xsl:attribute name="style">color: <xsl:value-of select="@color"/></xsl:attribute>
		<xsl:value-of select="@id"/>
	    </xsl:element>
	</td>
	<td><xsl:value-of select="@name"/></td>
	<td>
	    <xsl:if test="value">
		<xsl:value-of select="value/@min"/> to <xsl:value-of select="value/@max"/>
		<xsl:if test="value/@mean">(<xsl:value-of select="value/@mean"/>)</xsl:if>
	    </xsl:if>
	    <xsl:if test="mean">
		<xsl:value-of select="mean/@min"/> to <xsl:value-of select="mean/@max"/>
	    </xsl:if>
	    <xsl:if test="approximation">
		approximation
	    </xsl:if>
	</td>
    </tr>
 </xsl:template>

 
 <xsl:template match="Group">
    <div>
	<xsl:if test="count(../Group) &gt; 1">
	    <xsl:if test="@title">
		<h4>Group: <xsl:value-of select="@title"/></h4>
	    </xsl:if>
	</xsl:if>
	<table>
	    <tr>
		<th>ID</th>
		<th>Name</th>
		<xsl:if test="results/Value/mean"><th>Mean</th></xsl:if>
		<xsl:if test="not(results/Value/mean)"><th>Value</th></xsl:if>
	    </tr>
	    <xsl:apply-templates select="results/Value"/>
	</table>
    </div>
 </xsl:template>

 <xsl:template match="/result">
  <div>
    <xsl:if test="//Error">
	<span class="error"><xsl:value-of select="//Error"/></span>
    </xsl:if>
    

    <xsl:if test="not(//Error)">
	<xsl:if test="not(//Value)">
	    Nothing is selected
	</xsl:if>

	<xsl:apply-templates select="Group"/>
    </xsl:if>	
  </div>
 </xsl:template>
</xsl:stylesheet>