During some work I have been undertaking recently I hit a problem when trying to retrieve XML data from SharePoint Views of a List. For this work I simply connected to the views using a simple XMLTransform and render this out. Most lists worked well until I tried to view a list that contained a multi-line text field that was configured for either "RichText" or "Enhanced RichText" and had been populated by pasting from Word 2007. I noticed that when it rendered it for some reason got rid of the rest of my web part. Using the following Word 2007 content added to the field we get the following two different outputs (some text from a previous blog post).
List with RichText or Enhanced RichText – Standard HTML Content
List with RichText or Enhanced RichText – Word 2007 Content
After writing some "Regex" functions to clean the retrieved content and also setting normal parameters within the XML to clean it out I still had not gotten anywhere. So after a painstaking line by line test I found that hyperlinks that had been pasted from the browser Word first then this copied into the content field displayed the error shown in the first image. However this did not happen every time that a URL was pasted into the Word document. I am still unsure as to why it does it and am going to continue to try and sort it out. However the work around is to make sure that when adding hyperlinks into Word before pasting into the content field use the "Insert > Hyperlink" option and this will work.
UPDATE: After further investigation the error only occurs if the hyperlink is not text but the actual URL.
Works
Caching Data in Web Parts
Fails
http://www.helloitsliam.com/archive/2008/10/23/caching-data-in-web-parts.aspx
Does seem like a very strange issue but caused me a few problems. J |