XSL check param length
- by AdRock
I need to check if a param has got a value in it and if it has then do this line otherwise do this line.
I've got it working whereas I don't get errors but it's not taking the right branch
Here is the template which holds the html in the XSL stylesheet
<xsl:call-template name="volunteer_role">
<xsl:with-param name="volrole" select="volunteer/roles" />
</xsl:call-template>
and here is the template where there is a choice whether to take this brancg or that brach depending if the param is empty
<xsl:template name="volunteer_role">
<xsl:param name="volrole" select="'Not Available'" />
<div class="small bold">ROLES:</div>
<div class="large">
<xsl:choose>
<xsl:when test="string-length($volrole)!=0">
<xsl:value-of select="$volrole" />
</xsl:when>
<xsl:otherwise>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>