Re: [xsl] variable not found

Subject: Re: [xsl] variable not found
From: Ruud Grosmann <r.grosmann@xxxxxx>
Date: Thu, 27 Mar 2008 09:31:54 +0100
Z W wrote:
Hi

What did I do wrong here ?
Is there a workaround to this ?



xslt3_summary:
     [xslt] Processing omacm.jtl to reporting.html
     [xslt] Loading stylesheet summary_v3.xsl
     [xslt] v3.xsl:424: Fatal Error! XPath syntax error at char 9 on
line 424 in {$timeSpan}:
     [xslt]     Variable $timeSpan has not been declared


<xsl:template name="currentJTLDetail">


<xsl:for-each select="document($currentJTL)/testResults/*[not(@label =
preceding::*/@label)]">
<tr>
      <xsl:variable name="timeSpan" select="$maxTimeStamp_prev -
$minTimeStamp_prev" />
    </xsl:for-each>
			
			<td>
				<xsl:call-template name="display-seconds">
					<xsl:with-param name="value" select="$timeSpan" />
				</xsl:call-template>

Hi ZW.


The timespan variable only 'lives' in the scope of the for-each loop. You cannot use it outside the loop, as you have experienced.

Ruud

Current Thread