Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

Custom field XSLT rendering in Sp2010, not in SP2007

$
0
0

Hi,

I'm using a XSL file to render a custom field in list item view, instead of using the render pattern in the field definition XML. The XSLT code includes two links and an a image. This Renders in SP2010 with no issues but not in SP2007. Can any one coming from SP2007 background let me know the reason. The XSL file is as below:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema"
            xmlns:d="http://schemas.microsoft.com/sharepoint/dsp"
            version="1.0"
            exclude-result-prefixes="xsl msxsl ddwrt"
            xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
            xmlns:asp="http://schemas.microsoft.com/ASPNET/20"
            xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer"
            xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
            xmlns:msxsl="urn:schemas-microsoft-com:xslt"
            xmlns:SharePoint="Microsoft.SharePoint.WebControls"
            xmlns:ddwrt2="urn:frontpage:internal"
            xmlns:user="urn::my-scripts">


  <xsl:template match="FieldRef[@FieldType = 'DocDisplay']" mode="Text_body">

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

    <script type="text/javascript" src="_layouts/DocDisplay/DocDisplay.js"></script>
    <a href="#">
        <xsl:attribute name="onclick">

          var NewPopUp = SP.UI.$create_DialogOptions();

          NewPopUp.url = '/_layouts/*****/ABC.aspx;
          NewPopUp.title = 'View Doc';
          NewPopUp.width = 600;
          NewPopUp.height = 570;
          SP.UI.ModalDialog.showModalDialog(NewPopUp);
        </xsl:attribute>
        <img alt="link" src="/_layouts/DocStyle/Img/DisplayIcon.gif" style="border: none;"/>
      </a>

    <xsl:variable name="pdfId" select="$thisNode/@ID" />

    <a onclick="pdfDisplayInvoke('{$pdfId}')">Link</a>      
  </xsl:template >
</xsl:stylesheet>


Viewing all articles
Browse latest Browse all 11508

Trending Articles



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