SharePoint Data View Web Part Extension Functions in the ddwrt Namespace

Serge van den Oever wrote this MSDN article about the functions that are available in the ddwrt namespace.  He wrote it for SharePoint 2003 and posted it to MSDN in October 2005, but I’ve never found a newer or better reference for MOSS.  I’ve used Serge’s postings many times to help solve challenges, and I recommend him if you ever run across them.

I’ve found a few additions to Serge’s list below, but I haven’t been able to find documentation for most of them:

Function   (ddwrt:) Called with   (example) Result
amkeyfield ddwrt:amkeyfield=”ID” ???
amkeyvalue ddwrt:amkeyvalue=”ddwrt:EscapeDelims(string(@ID))” ???
ammode ddwrt:ammode=”view” ???
cf_ignore ddwrt:cf_ignore=”1″ ???
EscapeDelims ddwrt:EscapeDelims(string(@ID)) ???
EcmaScriptEncode ddwrt:EcmaScriptEncode(string(@ID)) Encodes a string   into the ECMAScript format.

Here are a few excerpts from Serge’s article (any references to FrontPage are still valid for SharePoint Designer):

Introduction

Microsoft Windows SharePoint Services provides the powerful Data View Web Part that can perform an Extensible Stylesheet Language Transformation (XSLT) on XML data retrieved from a data source. When you are working with a Web site based on Windows SharePoint Services from within Microsoft Office FrontPage 2003, you can use the Data View Web Part to do the following:

  • Define a query and data source from which to retrieve the XML data. Data sources can be SharePoint lists or external databases such as Microsoft SQL Server.
  • Define the XSLT transformation that converts XML retrieved from the data source into HTML. FrontPage offers a WYSIWYG experience for editing these XSLT views, including live data preview.

During the XSLT transformation process, the Data View Web Part uses an XSLT extension object that provides several functions in the ddwrt namespace. These functions perform tasks such as accessing properties of a SharePoint list or firing events to connected Web Parts. This article describes the functions implemented by the extension object.

Following is information about the set of functions implemented in the ddwrt namespace. These functions are prefixed with ddwrt in the XSLT code that is generated by FrontPage.

AutoHyperLink
AutoNewLine
ConnEncode
Counter
FieldFilterImageUrl
FieldFilterOptions
FieldPrefix
FieldSortImageUrl
FieldSortParameters
FilterLink
FormatDate
FormatDateTime
GenDisplayName
GenFireConnection
GenFireServerEvent
GetFileExtension
GetStringBeforeSeparator
GetVar
IfNew
IsPrivilegedUser
Limit
ListProperty
MapToAll
MapToControl
MapToIcon
NameChanged
PresenceEnabled
SelectOptions
SetVar
ThreadStamp
Today
TodayIso
UrlBaseName
UrlDirName
UrlEncode
URLLookup
UserLookup