Hi,
I'm a noob in XSL and need some help.
Look at the code below and, mainly, the bold lines.
<xsl:stylesheet version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls " xmlns:ddwrt2="urn:frontpage:internal">
<xsl:output method="html" indent="no"/>
<xsl:decimal-format NaN=""/>
<xsl:param name="dvt_apos">'</xsl:param>
<xsl:param name="Today">CurrentDate</xsl:param>
<xsl:variable name="dvt_1_automode">0</xsl:variable>
<xsl:template match="/" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls ">
<xsl:call-template name="dvt_1"/>
</xsl:template>
<xsl:template name="dvt_1">
<xsl:variable name="dvt_StyleName">Table</xsl:variable>
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
<xsl:variable name="Hoje" select="$Today-7"/>
<xsl:variable name="Average" select="sum($Rows[@Created=$Hoje]/@ResolveTime) div count($Rows[@Created=$Hoje]/@ResolveTime)"/>
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="ms-
vb" align="center" >
<span style="vertical-align:middle">
<xsl:if test="count($Rows)=0 or $Average=0">
0
<xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:whitespace-preserve="yes" xml:space="preserve" > Dias </xsl:text>
<img src="../images/KPI-0.gif" style="vertical-align:middle"/>
</xsl:if>
</span>
<!-- <where>
<gt>
<FieldRef Name="Created" Nullable="True" Type="DateTime" />
<Value Type="DateTime">
<Today OffSetDays="-7" /><Value Type="DateTime" IncludeTimeValue="TRUE"><Today /></Value>"
</Value>
</gt>
</where>-->
<xsl:choose>
<xsl:when test="$Average < 60 and count($Rows)!= 0">
<xsl:value-of select="format-number($Average, "###0;-###0")" />
<xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:whitespace-preserve="yes" xml:space="preserve" > Dias </xsl:text>
<img src="../images/KPI-0.gif" style="vertical-align:middle"/>
</xsl:when>
<xsl:when test="$Average > 60 and $Average < 120 and count($Rows)!= 0">
<xsl:value-of select="format-number($Average, "###0;-###0")" />
<xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:whitespace-preserve="yes" xml:space="preserve" > Dias </xsl:text>
<img src="../images/KPI-2.gif" style="vertical-align:middle"/>
</xsl:when>
<xsl:when test="count($Rows)!= 0">
<xsl:value-of select="format-number($Average, "###0;-###0")" />
<xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:whitespace-preserve="yes" xml:space="preserve" > Dias </xsl:text>
<img src="../images/KPI-1.gif" style="vertical-align:middle"/>
</xsl:when>
</xsl:choose>
</td>
</tr>
<tr valign="top">
<td align="center" >
<table><tr><td class="ms-
vb" >
<img src="../images/KPI-0.gif" align="absmiddle" /> <= 60 Minutos<br/>
<img src="../images/KPI-1.gif" align="absmiddle" /> <= 120 Dias<br/>
<img src="../images/KPI-2.gif" align="absmiddle" /> 5+ Dias<br />
</td></tr></table>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
Thx,
Andre