Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Concatenating two variables in xslt (non-numeric and/or numeric)

Tags:

xslt

i have two variables in xslt,i am not able to add those and assign to another variable, Any help would be appreciated.

<xsl:variable name="Book" select="hummpty" />
<xsl:variable name="Book1" select="andro" />
<xsl:variable name="Total">
<xsl:value-of select="$Book + $Book1/>
</xsl:variable>

When i try to print 'Total' i am getting value as NaN. How do i achieve this? After achieving this , i would like to assign this as an attribute value. eg:

<Book totakBook="$Total" />

Something like above. Any help appreciated.

like image 458
Parameswar Avatar asked Jun 18 '12 07:06

Parameswar


1 Answers

If you actually want to concatenate string values, try this:

<xsl:value-of select="concat($Book, $Book1)" />
like image 61
Filburt Avatar answered Sep 29 '22 12:09

Filburt