<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xslc="http://xslcomponents.org/TR/WD-xslc">
<xsl:import href="../xslc.xsl"/>
<xsl:import href="XMLCAdm_Tabs.xsl"/>
<xsl:template match="/">
<xsl:apply-templates select="document"/>
</xsl:template>
<xsl:template match="document">
<xsl:call-template name="xslc:Page">
<xsl:with-param name="Title">Compare stats</xsl:with-param>
<xsl:with-param name="ToolbarButtonsRight">
<xsl:call-template name="AdmCommonToolbarButtonsRight"/>
</xsl:with-param>
<xsl:with-param name="ActivePageName">XMLC_CompareStatsXMLService</xsl:with-param>
<xsl:with-param name="Tabs">
<xsl:call-template name="XMLCAdm_Tabs"/>
<Item Caption="{XMLModule}" Hint="{XMLModule}" Name="XMLC_CompareStatsXMLModule" HRef="{/document/XMLC_Params/XMLC_ScriptName}/XMLC_CompareStatsXMLModule?XMLModule={XMLModule}"/>
<Item Caption="{XMLServiceStats/XMLService}" Hint="{XMLServiceStats/XMLService}" Name="XMLC_CompareStatsXMLService" HRef="{/document/XMLC_Params/XMLC_ScriptName}/XMLC_CompareStatsXMLService?XMLModule={XMLModule}&amp;XMLService={XMLServiceStats/XMLService}"/>
</xsl:with-param>
<xsl:with-param name="DisplayTabs">1</xsl:with-param>
<xsl:with-param name="Body">
<table border="0" cellpadding="2" cellspacing="0" class="clFlatTable" width="100%">
<tr class="clRowHeader">
<td colspan="3">XMLGram AverageTime : <xsl:value-of select="XMLGramAverageTime"/>ms<br/>XMLGram RequestCount : <xsl:value-of select="XMLGramRequestCount"/>
<br/>XMLGram CPUTime : <xsl:value-of select="XMLGramCPUTime"/>
</td>
<td align="right" valign="top" colspan="{count(XMLServiceStats)}">&#160;</td>
</tr>
<tr class="clRowHeader">
<td valign="top">Kind</td>
<td valign="top">Name</td>
<td valign="top">Statement</td>
<xsl:apply-templates select="XMLServiceStats"/>
</tr>
<xsl:apply-templates select="XMLServiceStats[1]/XMLInstruction | XMLServiceStats[1]/Event"/>
</table>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="XMLServiceStats">
<td>
<xsl:value-of select="StatsDate"/>&#160;<a href="XMLC_DeleteStats?StatsDir={StatsDir}&amp;NextAction={/document/XMLC_Params/XMLC_Action}&amp;XMLModule={/document/XMLModule}&amp;XMLService={XMLService}">
<img alt="Delete Stats" border="0" src="{$XMLC_PictosPath}ico_xminus.gif"/>
</a>
<br/>
<xsl:value-of select="StatsTime"/>
</td>
</xsl:template>
<xsl:template match="XMLInstruction">
<xsl:variable name="clValue">
<xsl:choose>
<xsl:when test="position() mod 2 = 1">clRowDark</xsl:when>
<xsl:otherwise>clRowLight</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$clValue}">
<td valign="top">
<xsl:value-of select="Operation"/>&#160;<a href="/XMLRADBin/XMLRAD.dll/Default?ProjectName={$XMLC_InstanceName}&amp;XMLModule={/document/XMLModule}&amp;XMLService={/document/XMLServiceStats/XMLService}&amp;IName={Name}" target="_blank">
<img alt="Design in XMLRAD" border="0" src="{$XMLC_PictosPath}ico_step_right.gif"/>
</a>
</td>
<td valign="top">
<xsl:value-of select="Name"/>
</td>
<td valign="top">
<xsl:apply-templates select="Statement"/>
</td>
<xsl:variable name="CurrentName" select="Name"/>
<xsl:for-each select="/document/XMLServiceStats/XMLInstruction[Name=$CurrentName]">
<td valign="top" align="right">
<xsl:value-of select="AverageTime"/>
</td>
</xsl:for-each>
</tr>
</xsl:template>
<xsl:template match="Event">
<xsl:variable name="clValue">
<xsl:choose>
<xsl:when test="position() mod 2 = 1">clRowDark</xsl:when>
<xsl:otherwise>clRowLight</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$clValue}">
<td valign="top">
<xsl:value-of select="Operation"/>
</td>
<td valign="top">
<xsl:value-of select="Name"/>
</td>
<td valign="top">
<xsl:apply-templates select="Statement"/>
</td>
<xsl:variable name="CurrentOperation" select="Operation"/>
<xsl:for-each select="/document/XMLServiceStats/Event[Operation=$CurrentOperation]">
<td valign="top" align="right">
<xsl:value-of select="AverageTime"/>
</td>
</xsl:for-each>
</tr>
</xsl:template>
</xsl:stylesheet>
