I've been chasing some weird problems with a Custom Field Type on a page that has a list view web part with Designer-provided Conditional Formatting.

It seems like the XSL for the fields have been frozen since I added the Conditional Formatting; it no longer changes when the custom field type's XSL is updated and redeployed.

Unfortunately it could be that I'm suffering a symptom of a deployment problem, so I'm just checking that I'm not chasing my own tail.

Is the XSL frozen/copied/snapshotted by SharePoint Designer; and if so, is this feature documented anywhere?

3 Answers 3


I think here you will need, first of all, to understand, how the conditional formatting actually works.

Conditional formatting in SPD is not more than a visual way to define Xsl property of XsltListViewWebPart and other standard webparts, which use xsl transformations. Xsl property contains custom xsl code, and links to standard SharePoint xslt files, like main.xsl.

By default, XsltListViewWebPart receives your data in some xml representation, then applies transformations, defined in main.xsl and other SharePoint files, and after this you're getting the final html.

But if Xsl property is defined, XsltListViewWebPart will use it, rather than standard transformations.

From this point, you can see now, that if you will define something in Xsl property (how the conditional formatting tool does), you can modify main.xsl file and other standard transformations files as many times as you wish - but SharePoint will always use local Xsl property.

Fortunately, XSL transformations allow to use links to standard files inside your customized Xsl property. So, Xsl property redefines not the whole main.xsl file, but only small parts of it. These parts (called xsl templates), however, are copy-pasted from their sources, and detached from sources from that moment.

So, if your formatting freezes, the only solution here is to reapply conditional formatting each time you change something in your custom field rendering template.

You can examine the Xsl code, which were generated by conditional formatting tool, selecting the Code tab at the bottom pane in SPD:

SPD Code tab

Here is an example for Xsl property, generated by conditional formatting, which changes background color to green for one column, if title of the item contains text 'Green' (formatted & commented by me, of course, don't think SharePoint indents the code :) ):

   exclude-result-prefixes="xsl msxsl ddwrt" 

  <!-- linked files -->
  <xsl:include href="/_layouts/xsl/main.xsl"/> 
  <xsl:include href="/_layouts/xsl/internal.xsl"/> 

  <xsl:param name="AllRows" select="/dsQueryResponse/Rows/Row[$EntityName = '' or (position() &gt;= $FirstRow and position() &lt;= $LastRow)]"/>
  <xsl:param name="dvt_apos">&apos;</xsl:param>

  <!-- this xsl template is redefined -->

    <xsl:param name="thisNode" select="."/>
    <xsl:param name="class" />

        <!-- attributes for td -->

        <xsl:attribute name="style">

            <!-- here our 'green' condition is evaluated, and the green background is applied -->
              test="contains(normalize-space($thisNode/@Title), 'Green')"
              ddwrt:cf_explicit="1">background-color: #71B84F;</xsl:if>


        <!-- and this xsl code below is copy-pasted from some standard files -->
        <!-- it doesn't do any conditional formatting work, as you can see -->
        <!-- it is now detached from it's source -->

        <xsl:if test="@ClassInfo='Menu' or @ListItemMenu='TRUE'">
            <xsl:attribute name="height">100%</xsl:attribute>
            <xsl:attribute name="onmouseover">OnChildItem(this)</xsl:attribute>
        <xsl:attribute name="class">
            <xsl:call-template name="getTDClassValue">
              <xsl:with-param name="class" select="$class" />
              <xsl:with-param name="Type" select="@Type"/>
              <xsl:with-param name="ClassInfo" select="@ClassInfo"/>

        <!-- next, inner template is called here -->
        <xsl:apply-templates select="." mode="PrintFieldWithECB">
            <xsl:with-param name="thisNode" select="$thisNode"/>


I'm not quite sure what you mean. XSL is just the XML processing instructions that convert the XML data into HTML for display on the page. So yes, the XSL would be static in that regard. Conditional formatting is just further instructions on how to handle particular rows of data that is output.

  • Ah, I see the confusion: the XSL for the field rendering is not static as would normally be the case because I'm changing the field type's own XSL and redeploying it to see the results. I'll update my question.
    – Stu Pegg
    May 17, 2011 at 20:36

I've noticed when working with the XSLT List View Web Part, that sometimes changes to the XSLT do not show up. This usually happens to me because there is some invalid XSLT in my stylesheet, so it uses the last stylesheet that worked. As long as there is invalid XSLT it continues to use the old stylesheet. Try opening your page in design mode of Designer, look at where the web part should be, and see if there is an error message displayed. I don't know if this is what's happening to you, but it worth a look.

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.