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

Has anybody upgraded an old custom field type to use the new XSL transform in SharePoint 2010? I have a multi-column field type, and want the Display pattern to render the 2nd "column", which contains a hyperlink. My CAML render pattern looks like:

<RenderPattern Name="DisplayPattern">
         <Column />
      <Case Value="" />
         <HTML><![CDATA[<a href=']]></HTML>
         <Column SubColumnNumber="1" HTMLEncode="TRUE" />
         <Column SubColumnNumber="1" HTMLEncode="TRUE" />

In WSS 3.0, this would render the 2nd column in the field as a hyperlink in the LVWP, which is what I want. In SharePoint 2010, I tried adding TRUE to my field type definition, but that ends up rendering the actual anchor tag, as opposed to a clickable hyperlink:

<a href=""></a>

So then I tried creating a XSL transform, since that is supposed to be the new and improved way of doing this. Unfortunately, I can't get that to work either. I am getting the same thing I got using the RenderPattern. I'm no XSL expert, so can anyone confirm (or deny) that the following looks legitimate (or suggest a better way to do it)?

<xsl:stylesheet xmlns:x="" xmlns:d="" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="" xmlns:asp="" xmlns:__designer="" xmlns:xsl="" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">

  <xsl:template match="FieldRef[@FieldType='DataLinkUrl']" mode="Note_body">
    <xsl:param name="thisNode" select="."/>
    <xsl:variable name="url">
      <xsl:value-of select="substring-before(substring-after(substring-after($thisNode/@*[name()=current()/@Name],';#'),';#'),';#')"/>
    <a href="{$url}"><xsl:value-of select="$url"/></a>

share|improve this question

This link will help you to understand how mode attribute value is calculated.

share|improve this answer
Thanks, that was helpful in confirming what I already had for the "mode" attribute. In case anyone is interested in the future, I ended up using the ddwrt:HtmlDecode function to get my URL properly decoded: <xsl:variable name="link"> <xsl:value-of disable-output-escaping="yes" select="substring-after(ddwrt:HtmlDecode($thisNode/@*[name()=current()/@Name]),'‌​,')" /> </xsl:variable> <a href="{substring-before(substring-after($link,'href=&quot;'),', ')}">Link</a> – jason.venema Sep 20 '10 at 16:04

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.