Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Getting value of @Category field in xslt

$
0
0

Hi,

Any Ideas how to get value of @Category field (lookup/dropdown field) and check it's value?

Idea is to style ".date" based on value in field.

Below what if have tried :

<xsl:variable name="class" select="@Category" />
<xsl:choose>
    <xsl:when test="contains($class,'fault')">
            <span class="date" style="background:red;">
            <xsl:value-of select="ddwrt:FormatDateTime(@StartTime,1033,'M.d.yyyy')" />
            </span>
    </xsl:when>

    <xsl:when test="contains($class,'break')">
            <span class="date" style="background:yellow;">
            <xsl:value-of select="ddwrt:FormatDateTime(@StartTime,1033,'M.d.yyyy')" />
            </span>
    </xsl:when>

    <xsl:otherwise>
        <span class="date" style="background:green;">
            <xsl:value-of select="ddwrt:FormatDateTime(@StartTime,1033,'M.d.yyyy')" />
            </span>
    </xsl:otherwise>
</xsl:choose>



Antti Astikainen


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>