How to add two value in xslt

A

ad

I have a xslt file, there are tree columns in a table,
There is Value1 in column 1 and Value2 in column2.
The type of Value1 and Value2 are number.
I want to add Value1 and Value2 together and display it in column3
I use <xsl:value-of select="Value1"/>+ <xsl:value-of
select="Value2"/>
in the below example, but it display as string concatenate , not number add.

How can I do a number adding in xslt?


----------------------------------------------------------------------------------------------------------------------------

<table width="100%" border="1">
<tbody>
<xsl:for-each select="DocumentElement/SightMatrix">
<tr>
<td width="24%">
<xsl:value-of select="Value1"/>
</td>
<td width="24%">
<xsl:value-of select="Value2"/>
</td>
<td width="24%">
<xsl:value-of select="Value1"/>+
<xsl:value-of select="Value2"/>
</td>
</tr>
</xsl:for-each>
</tbody>
</table>
 

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,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top