Test for Null in XSLT Data View

If you insert a data view webpart and then style the td cells for borders, it will not style the empty cells.  Very annoying.  One way to fix this is to use the xsl:choose tag to do an if/otherwise test for null.

<xsl:choose>

<xsl:when test="categoryName !=null">

        <xsl:value-of select="categoryName " />

</xsl:when>

<xsl:otherwise>

        <xsl:value-of select="other" />

</xsl:otherwise>

</xsl:choose>

Comments

Popular posts from this blog

SharePoint Designer 2013 Approval Workflow with Comments

Change SharePoint server hostname and Web Application Names

SharePoint Search - Content Processing Pipeline Failed to Process the Item