equal
deleted
inserted
replaced
|
1 <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
|
2 |
|
3 <!-- Main template --> |
|
4 <xsl:template match="/buildStatus"> |
|
5 <xsl:variable name="criticalCount" select="count(phase/step/failures[@level='critical']/failure)"/> |
|
6 <xsl:variable name="majorCount" select="count(phase/step/failures[@level='major']/failure)"/> |
|
7 <xsl:variable name="minorCount" select="count(phase/step/failures[@level='minor']/failure)"/> |
|
8 <xsl:variable name="unknownCount" select="count(phase/step/failures[@level!='critical' and @level!='major' and @level!='minor']/failure)"/> |
|
9 |
|
10 <diamonds-build> |
|
11 <schema>13</schema> |
|
12 <build> |
|
13 <status> |
|
14 <xsl:choose> |
|
15 <xsl:when test="$criticalCount != 0">Black</xsl:when> |
|
16 <xsl:when test="$majorCount != 0">Red</xsl:when> |
|
17 <xsl:when test="$minorCount != 0">Amber</xsl:when> |
|
18 <xsl:when test="$unknownCount != 0">Green</xsl:when> |
|
19 <xsl:otherwise>Gold</xsl:otherwise> |
|
20 </xsl:choose> |
|
21 </status> |
|
22 </build> |
|
23 </diamonds-build> |
|
24 </xsl:template> |
|
25 |
|
26 </xsl:stylesheet> |
|
27 |