SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 4 down vote accepted

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,


share|improve this answer
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 '12 at 18:35
Glad it helped:) – Vadim Gremyachev Dec 25 '12 at 18:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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