Say I want to grab a choice field via xsl. What is the right binding for mode? I can't find this information anywhere, and I've tried everything in its place!

  • Text_body ?
  • Choice_body ?
  • MultiChoice_body ?

    <xsl:template match="FieldRef[@Name='myChoice']" mode="Choice_body">
        <xsl:param name="thisNode" select="."/>
        <td class="someclass">{$thisNode/@myChoice}</td>

Does anyone have a clue?

[Later...] It's been awhile now, I guess this is a hard question.

1 Answer 1


In order to define Custom Rendering for a SPFieldChoice in template for mode attribute should be used value body

For example, if we apply for Tasks list that contains Status field (SPFieldChoice) the following XSLT style sheet

<xsl:template match ="FieldRef[@Name='Status']" mode="body">
    <xsl:param name="thisNode" select="."/>
            <xsl:when test="$thisNode/@Status='Not Started'">
                <img src="/_layouts/images/tasknotdone.gif"/>
            <xsl:when test="$thisNode/@Status='In Progress'">
                <img src="/_layouts/images/taskpane.gif"/>
            <xsl:when test="$thisNode/@Status='Completed'">
                <img src="/_layouts/images/taskdone.gif"/>
                <xsl:value-of select="$thisNode/@Status" />

the List View will be rendered as shown below

enter image description here

Hope this helps,


  • 1
    Hey! That did it! +1 solved! However, I like to use css, so instead of img tags, I inserted: <span class="statusRating3"></span> and then used my css to insert the icons as background images.
    – bgmCoder
    Dec 25, 2012 at 18:35
  • Glad it helped:) Dec 25, 2012 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.