Vi posto anche l'operatore condizionale:
codice:
<xsl:choose>
<xsl:when test="@MIME='text/html' or @MIME='' or not(@MIME)">[img]...[/img]</xsl:when>
<xsl:when test="@MIME='text/plain'">[img]...[/img]</xsl:when>
<xsl:when test="@MIME='application/rtf'">[img]...[/img]</xsl:when>
<xsl:when test="@MIME='application/pdf'">[img]...[/img]</xsl:when>
<xsl:when test="@MIME='application/postscript'">[img]...[/img]</xsl:when>
<xsl:when test="@MIME='application/vnd.ms-powerpoint'">[img]...[/img]</xsl:when>
<xsl:when test="@MIME='application/vnd.ms-excel'">[img]...[/img]</xsl:when>
<xsl:when test="@MIME='application/msword'">[img]...[/img]</xsl:when>
<xsl:when test="@MIME='image/jpeg'">[img]...[/img]</xsl:when>
<xsl:otherwise>
<xsl:variable name="extension">
<xsl:call-template name="last_substring_after">
<xsl:with-param name="string" select="substring-after(
$temp_url,
'/')"/>
<xsl:with-param name="separator" select="'.'"/>
<xsl:with-param name="fallback" select="'UNKNOWN'"/>
</xsl:call-template>
</xsl:variable>
[<xsl:value-of select="translate($extension,$lower,$upper)"/>]
</xsl:otherwise>
</xsl:choose>