Forum Moderators: open
<xsl:template name="compare">
<xsl:param name="i"/>
<xsl:param name="count"/>
<xsl:for-each select="../../client">
<td>
<xsl:value-of select="roam[$count]/@timing"/>
THIS STILL WORKS- <xsl:value-of select="$count"/>
</td>
</xsl:for-each>
</xsl:template>
<xsl:template match="/">
<table border="0" width="800px">
<xsl:for-each select="test/run/security/testCase/client[1]/roam">
<tr>
<td><xsl:number/></td>
<xsl:call-template name="compare">
<xsl:with-param name="i">1</xsl:with-param>
<xsl:with-param name="count"><xsl:number/></xsl:with-param>
</xsl:call-template>
</tr>
</xsl:for-each>
</table>
</xsl:template>
A sample of my xml is:
<?xml version="1.0" encoding="iso-8859-1"?>
<test>
<run>
<security>
<testCase id="Roam Test" len="20" num="10">
<client id="0">
<roam timing="11"></roam>
<roam timing="12"></roam>
<roam timing="13"></roam>
<roam timing="14"></roam>
<roam timing="15"></roam>
</client>
<client id="1">
<roam timing="21"></roam>
<roam timing="22"></roam>
<roam timing="23"></roam>
<roam timing="24"></roam>
<roam timing="25"></roam>
</client>
</testCase>
</security>
</run>
</test>
What I am looking for is it to create a column for client 1 and 2 with each row being a new roam. however even though count can be properly show with...
<xsl:value-of select="$count"/>
and...
<xsl:value-of select="roam[2]/@timing"/>
will select the second roam for each client...
<xsl:value-of select="roam[$count]/@timing"/>
will always display the first roams for both clients. Is there an easy syntax fix or a work around for this? Thanks in advanced!