Mukal,
Another 2 questions I have:
1- Because this
<td>
code below is getting larger
</td>
how do I do a call-template and passing in with this variable cib_time_duration
and perform its task there in another template ?
I ask cuz I like to shorten the <td> section here.
2- l have several input xml files that would fill in this <td> section.
Is it possibe in XSLT to determine which output to display based on
a particular xml input file. Each of these input file would be going
through the same for-each to find its timeSpan.
On Thu, Mar 27, 2008 at 3:39 AM, Z W <mpc8250(_at_)gmail(_dot_)com> wrote:
Mukal
Want to acknowledge your help there.
Thank you for that help.
On Thu, Mar 27, 2008 at 3:32 AM, Mukul Gandhi
<gandhi(_dot_)mukul(_at_)gmail(_dot_)com> wrote:
On 3/27/08, Z W <mpc8250(_at_)gmail(_dot_)com> wrote:
<td>
<xsl:variable name="cib_time_duration">
<xsl:for-each select="document($currentJTL)/testResults/*[not(@label =
preceding::*/@label)]">
<xsl:variable name="minTimeStamp_prev_2">
<xsl:call-template name="find_minTimeStamp_prev_2">
<xsl:with-param
name="nodes" select="/testResults/sampleResult" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="maxTimeStamp_prev_2">
<xsl:call-template name="find_maxTimeStamp_prev_2">
<xsl:with-param name="nodes" select="/testResults/sampleResult" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="timeSpan" select="$maxTimeStamp_prev_2
-$minTimeStamp_prev_2" />
<xsl:value-of select="$timeSpan"/>
</xsl:for-each>
</xsl:variable>
<xsl:value-of select="$cib_time_duration"/>
</td>
But I get the $cib_time_duration printed 3 times. How do I get it to
print once ?
This might solve the problem
<xsl:variable name="cib_time_duration">
<xsl:for-each select="document($currentJTL)/testResults/*[not(@label =
preceding::*/@label)]">
<!-- keep the code here
as it is
-->
<xsl:if test="position() = last()">
<xsl:value-of select="$timeSpan"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:value-of select="$cib_time_duration" />
Though I have a feeling, you can structure the code even better.
--
Regards,
Mukul Gandhi
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--