how to reassign variable

  • Thread starter biswaranjan.rath
  • Start date
B

biswaranjan.rath

Can i do something like this:

<xsl:variable name="varMaxDiffId">
<xsl:choose>
<xsl:when test="$varMaxDiffId == 'NULL'">
<xsl:value-of select="-1"/>
</xsl:when>
<xsl:when test="$varMaxDiffId < @unique_diff_id">
<xsl:value-of select="@unique_diff_id"/>
</xsl:when>
</xsl:choose>
</xsl:variable>

Please suggest some solution. I want to find out maximum unique_diff_id
from the document.

Thanks,
Biswaranjan
 
J

Joe Kesselman

XSLT variables are single-assignment, and their values may not be
changed. Use a new variable name to hold the result of your computation.
 
J

Joe Kesselman

Joe said:
XSLT variables are single-assignment, and their values may not be
changed. Use a new variable name to hold the result of your computation.

.... or use functions built into XSLT (I believe there is a max operation)

.... or, if you really need to write a loop evaluation, reconstruct it as
a recursion. Common solution, but look for others first.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top