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'm following this web article on configuring content query web part - http://erikswenson.blogspot.com/2010/03/sharepoint-2010-content-query-for-blog.html

When I try to add this line to my xsl

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

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
add comment

1 Answer 1

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:

xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"

You can see more details on this idea here: https://www.nothingbutsharepoint.com/sites/eusp/Pages/An-Update---How-to-Configure-a-Custom-Item-Style-for-a-Discussion-Board-using-the-Content-Query-Web-Part.aspx

share|improve this answer
    
thanks I found it in this link as well - labs.steveottenad.com/sharepoint-2010-xslt-date-formatting –  gotsp May 10 '11 at 2:17
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.