In my continuing development of SharePoint (and without any formal training) I stumbled upon a solution something that has bugged me for a LONG while. And it also had some M$ Gold partners baffled since we were both early adopters of SharePoint 2010…

Here’s the situation: When creating a custom data view in SharePoint Designer 2010 based on a SharePoint list, special characters get displayed as encoded HTML code (e.g. the Apostrophe becomes #39;)

When I first created the above table in SPD by adding an Data View, it generated a bunch of XML and when I looked at the code I saw the following:

No surprise here… by selecting the item in the GUI editor, it auto-highlighted this line of code in the Code view…

But for a while I avoided creating custom data views because I didn’t know much about XML, XSLT, and that whole world of data formatting.

To fix this, all I had to do was simply add to this xsl:value-of tag the attribute disable-output-escaping=”yes”

Now my table shows up correctly!

Not rocket science, but definitely something good to know!

Credits go to Jeremy Jameson and his article on Web Standards Design with SharePoint, Part 5 (a.k.a. Rendering Semantic HTML using XsltListViewWebPart):

Comments are closed.