I'm using an XSLTprocessor script to get data from an external source. Now I would like to test wether a certain value is empty and then return a empty field. this is the code I'm using now in my XSL stylesheet.
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<table border="1" style="width:600px;margin-top:20px">
<tr>
<th align="left" style="text-transform: uppercase; font-size: 14px; color: white;font-weight: normal;">Date</th>
<th align="left" style="text-transform: uppercase; font-size: 14px; color: white;font-weight: normal;">Location</th>
<th align="right" style="text-transform: uppercase; font-size: 14px; color: white;font-weight: normal;">City</th>
<th align="right" style="text-transform: uppercase; font-size: 14px; color: white;font-weight: normal;">Country</th>
<th align="right" style="text-transform: uppercase; font-size: 14px; color: white;font-weight: normal;">Facebook</th>
</tr>
<xsl:for-each select="//item">
<tr>
<td style="text-align:left;"><xsl:value-of select="date" /></td>
<td style="text-align:left;color:#ccc;"><xsl:value-of select="location" /></td>
<td style="text-align:right;"><xsl:value-of select="city "/></td>
<td style="text-align:right;"><xsl:value-of select="country" /></td>
<td style="text-align:right;"><a>
<xsl:attribute name="href">
<xsl:value-of select="website" />
</xsl:attribute>
<xsl:attribute name="target">new</xsl:attribute>
I'm Attending
</a></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
I would like to have a conditional statement on the "website" value which returns a link to a Facebook event link. But when nothing is filled in the system where the data comes from, it should not display the link (I'm Attending)
How can this be preformed with a XSL test or some kind of conditional statement?