Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XSL if test display content when it has values

I have an if test where I want to display the content of the 'year' property with a comma when the property has values. This isn't working so I would be thankful for suggestions.

<xsl:if test="year != null">
     <xsl:value-of select="year"/>,
</xsl:if> 
like image 828
Cecil Theodore Avatar asked Nov 04 '11 10:11

Cecil Theodore


1 Answers

You can check year element presence simply using this expression:

<xsl:if test="year">

If you want to check that year element isn't empty:

<xsl:if test="year != ''">
like image 135
Kirill Polishchuk Avatar answered Nov 13 '22 06:11

Kirill Polishchuk