common/tools/brag/brag.xsl
changeset 547 19f9d5fc6406
child 557 c6145fb2403d
equal deleted inserted replaced
546:1c8d0b0d08dc 547:19f9d5fc6406
       
     1 <xsl:stylesheet version="1.0"
       
     2 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       
     3 	xmlns:fn="http://www.w3.org/2005/xpath-functions"
       
     4 	>
       
     5 <xsl:template match="/">
       
     6 	<html>
       
     7 	<link href="http://developer.symbian.org/css/reset.css" rel="stylesheet" type="text/css" />
       
     8 	<link href="http://developer.symbian.org/css/portal-merged.css" rel="stylesheet" type="text/css" />
       
     9 	<link href="http://developer.symbian.org/css/iefix.css" rel="stylesheet" type="text/css" />
       
    10 	<head><title>Build Status</title></head>
       
    11 	<body>
       
    12 	<h2>Build Status</h2>
       
    13 	<table border="1">
       
    14 
       
    15 	<xsl:for-each select="stage">
       
    16 		<tr>
       
    17 		<th>Stage: <xsl:value-of select="@name"/></th>
       
    18 		</tr>
       
    19 		<xsl:for-each select="step">
       
    20 			<tr>
       
    21 			<td>Step: <xsl:value-of select="@name"/></td>
       
    22 			</tr>
       
    23 			<xsl:for-each select="failures">
       
    24 				<tr>
       
    25 				<td>Failures: <xsl:value-of select="@level"/></td>
       
    26 				<td>Number: <xsl:value-of select="count(failure)"/></td>
       
    27 				</tr>
       
    28 			</xsl:for-each>
       
    29 		</xsl:for-each>
       
    30 	</xsl:for-each>
       
    31 
       
    32 	</table>
       
    33 
       
    34 	<xsl:variable name="criticalCount" select="count(stage/step/failures[@level='critical']/failure)"/>
       
    35 	<xsl:variable name="majorCount" select="count(stage/step/failures[@level='major']/failure)"/>
       
    36 	<xsl:variable name="minorCount" select="count(stage/step/failures[@level='minor']/failure)"/>
       
    37 	<xsl:variable name="unknownCount" select="count(stage/step/failures[@level!='critical' and @level!='major' and @level!='minor']/failure)"/>
       
    38 
       
    39 	<p>Total number of critical errors = <xsl:value-of select="$criticalCount"/></p>
       
    40 	<p>Total number of major errors = <xsl:value-of select="$majorCount"/></p>
       
    41 	<p>Total number of minor errors = <xsl:value-of select="$minorCount"/></p>
       
    42 	<p>Total number of unknown errors = <xsl:value-of select="$unknownCount"/></p>
       
    43 
       
    44 	<h2>
       
    45 	Final BRAG staus: 
       
    46 	<xsl:choose>
       
    47 		<xsl:when test="$criticalCount != 0">BLACK</xsl:when>
       
    48 		<xsl:when test="$majorCount != 0">RED</xsl:when>
       
    49 		<xsl:when test="$minorCount != 0">AMBER</xsl:when>
       
    50 		<xsl:when test="$unknownCount != 0">GREEN</xsl:when>
       
    51 		<xsl:otherwise>GOLD!</xsl:otherwise>
       
    52 	</xsl:choose>
       
    53 	</h2>
       
    54 
       
    55 	</body>
       
    56 	</html>
       
    57 </xsl:template>
       
    58 
       
    59 </xsl:stylesheet>
       
    60