Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a question regarding the vwstyles.xsl for XsltListViewWebPart. Basically I have a strange behavior, when I change the vwstyles.xls but not directly but by the fldtype_somename.xsl, the changes I perfrom are not reflected in the display. The change I do is quiet simple I just move a link to the top instead of the bottom, I'm sure that my file is loaded as i see it in the defenition and I see the xslt changes when I observe it with the SharePoint Developer, BUT no changes are applied on the webpart. It is really odd!

Anyone know why it isn't displayig changes? Althought I repeat when I see it in SharePoint Developer the changes which I made are present.

If i for example open a default XsltListViewWebPart xslt preview and perfomr there same change the display of the webpart will change, but not how I'm doing.

Here is the modified template:

    <xsl:if test="Toolbar[@Type='Freeform'] or ($MasterVersion=4 and Toolbar[@Type='Standard'])">
  <xsl:call-template name="Freeform">
    <xsl:with-param name="AddNewText">
      <xsl:choose>
        <xsl:when test="List/@TemplateType='104'">
          <!-- announcement-->
          <xsl:value-of select="$Rows/@resource.wss.idHomePageNewAnnounce"/>
        </xsl:when>
        <xsl:when test="List/@TemplateType='101' or List/@TemplateType='115'">
          <!-- doc lib or form lib-->
          <xsl:value-of select="$Rows/@resource.wss.Add_New_Document"/>
        </xsl:when>
        <xsl:when test="List/@TemplateType='103'">
          <!-- link -->
          <xsl:value-of select="$Rows/@resource.wss.AddNewLink"/>
        </xsl:when>
        <xsl:when test="List/@TemplateType='106'">
          <!-- Event -->
          <xsl:value-of select="$Rows/@resource.wss.AddNewEvent"/>
        </xsl:when>
        <xsl:when test="List/@TemplateType='119'">
          <!-- Wiki Library -->
          <xsl:value-of select="$Rows/@resource.wss.AddNewWikiPage"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$Rows/@resource.wss.addnewitem"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:with-param>
    <xsl:with-param name="ID">
      <xsl:choose>
      <xsl:when test="List/@TemplateType='104'">idHomePageNewAnnouncement</xsl:when>
      <xsl:when test="List/@TemplateType='101'">idHomePageNewDocument</xsl:when>
      <xsl:when test="List/@TemplateType='103'">idHomePageNewLink</xsl:when>
      <xsl:when test="List/@TemplateType='106'">idHomePageNewEvent</xsl:when>
      <xsl:when test="List/@TemplateType='119'">idHomePageNewWikiPage</xsl:when>
      <xsl:otherwise>idHomePageNewItem</xsl:otherwise>
      </xsl:choose>
    </xsl:with-param>
  </xsl:call-template>
</xsl:if>

<!-- Only if not doing the default view and toolbar type is standard (not freeform or none)-->
<xsl:if test="($IsGhosted = '0' and $MasterVersion=3 and Toolbar[@Type='Standard']) or $ShowAlways">
  <xsl:call-template name="ListViewToolbar"/>
</xsl:if>

<table width="100%" cellspacing="0" cellpadding="0" border="0">
  <!-- not show ctx for survey overview-->
  <xsl:if test="not($NoCTX)">
    <xsl:call-template name="CTXGeneration"/>
  </xsl:if>
  <xsl:if test="List/@TemplateType=109">
    <xsl:call-template name="PicLibScriptGeneration"/>
  </xsl:if>
  <tr>
    <td>
      <xsl:if test="not($NoAJAX)">
        <iframe src="javascript:false;" id="FilterIframe{$ViewCounter}" name="FilterIframe{$ViewCounter}" style="display:none" height="0" width="0" FilterLink="{$FilterLink}"></iframe>
      </xsl:if>
      <table summary="{List/@title} {List/@description}" xmlns:o="urn:schemas-microsoft-com:office:office" o:WebQuerySourceHref="{$HttpPath}&amp;XMLDATA=1&amp;RowLimit=0&amp;View={$View}" 
                      width="100%" border="0" cellspacing="0" dir="{List/@Direction}">
        <xsl:if test="not($NoCTX)">
          <xsl:attribute name="onmouseover">EnsureSelectionHandler(event,this,<xsl:value-of select ="$ViewCounter"/>)</xsl:attribute>
        </xsl:if>
        <xsl:if test="$NoAJAX">
          <xsl:attribute name="FilterLink">
            <xsl:value-of select="$FilterLink"/>
          </xsl:attribute>
        </xsl:if>
        <xsl:attribute name="cellpadding">
          <xsl:choose>
            <xsl:when test="ViewStyle/@ID='15' or ViewStyle/@ID='16'">0</xsl:when>
            <xsl:otherwise>1</xsl:otherwise>
          </xsl:choose>
        </xsl:attribute>
        <xsl:attribute name="id">
          <xsl:choose>
            <xsl:when test="$IsDocLib or dvt_RowCount = 0">onetidDoclibViewTbl0</xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="concat($List, '-', $View)"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:attribute>
        <xsl:attribute name="class">
          <xsl:choose>
            <xsl:when test="ViewStyle/@ID='0' or ViewStyle/@ID='17'"><xsl:value-of select="$ViewClassName"/> ms-basictable</xsl:when>
            <xsl:otherwise><xsl:value-of select="$ViewClassName"/></xsl:otherwise>
          </xsl:choose>
        </xsl:attribute>
        <xsl:if test="$InlineEdit">
          <xsl:attribute name="inlineedit">javascript: <xsl:value-of select="ddwrt:GenFireServerEvent('__cancel;dvt_form_key={@ID}')"/>;CoreInvoke('ExpGroupOnPageLoad', 'true');</xsl:attribute>
        </xsl:if>
        <xsl:apply-templates select="." mode="full">
          <xsl:with-param name="ShowSelectAllCheckbox" select="$ShowSelectAllCheckbox"/>
        </xsl:apply-templates>
      </table>
          <xsl:choose>
            <xsl:when test="$IsDocLib or dvt_RowCount = 0"><script type='text/javascript'>HideListViewRows("onetidDoclibViewTbl0");</script></xsl:when>
            <xsl:otherwise>
              <script type='text/javascript'><xsl:value-of select ="concat('HideListViewRows(&quot;', $List, '-', $View, '&quot;);')"/></script>
            </xsl:otherwise>
          </xsl:choose>
    </td>
  </tr>
  <xsl:if test="$dvt_RowCount = 0 and not (@BaseViewID='3' and List/@TemplateType='102')">
    <tr>
      <td>
         <table width="100%" border="0" dir="{List/@Direction}">
           <xsl:call-template name="EmptyTemplate" />
         </table>
      </td>
    </tr>
  </xsl:if>
</table>
<!-- rowlimit doesn't show page footer-->
<xsl:call-template name="pagingButtons" />

share|improve this question
    
In my experience, if your XSLT is invalid or broken SP2010 will usually just use the last known good version (instead of throwing an error). This makes debugging rather difficult. My guess is that your updated XSLT has a syntax error somewhere. –  Olly Hodgson Nov 2 '12 at 10:18
add comment

2 Answers 2

When an instance of a webpart is created it also creates an instance of the xsl.

You can manually update this I believe in the webpart settings or just remove and re-add the webpart.

share|improve this answer
    
I don't know I think it is totaly broken, no where it is working, my change which should be applied to all those webparts by default as I overwrite the default template, but I don't understand why it isn't applied! –  Shkipper Aug 30 '12 at 19:40
add comment

See this thread by Jalali Shakib: Why is changing on VWSTYLES.XML file not taking effect when I run iisreset?.

I found it useful for this case. By changing both files and running iisreset, I can see the changes.

share|improve this answer
add comment

Your Answer

 
discard

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.