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

I'm following this web article on configuring content query web part -

When I try to add this line to my xsl

<xsl:variable name="StartDate"> 
    <xsl:value-of select="ddwrt:FormatDateTime(string(@Modified), 1033, 'g')" /> 

I get an error message

Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.

Correlation ID:e684f7ba-32f3-418b-83a9-e2c4f228d5e5

The log file has this.

Error while executing web part: System.Xml.Xsl.XslLoadException: Prefix 'ddwrt' is not defined

Where/How do I add this namespace to ItemStyle.xsl?

share|improve this question
up vote 6 down vote accepted

You'll need to make sure that the xsl:stylesheet declares the ddwrt namespace. To do this, you'll need to add this to your xsl:stylesheet declaration if it isn't there already, though in your case we know it isn't because you're getting an error:


You can see more details on this idea here:

share|improve this answer
thanks I found it in this link as well - – gotsp May 10 '11 at 2:17

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.