You try to use a Data Form Web Part (Data View Web Part) to display a document library in an XSLT view. You find out that documents that include an apostrophe character (') in their file name, cannot be opened or viewed. (There might be other problematic characters beside apostrophe, I haven't checked that)
Steps to reproduce:
- Create a document library. Add some files with apostrophe in their name to the library.
- Click on one of those items. The file opens as expected.
- Open SharePoint Designer 2007, and browse to the document library. Open the page you have just viewed (Forms\Allitems.aspx).
- In design mode, right click on the document library web part (List View Web Part) and click on "Convert to XSLT view".
- Save the page, and open it in browser.
- Click on one of the items again. This time the file won't open, giving you 400 error.
This bug is happening because the URL of the file is now encoded, converting apostrophe chars to this: '. This encoding format is good for HTML and not for URL.
- Open SharePoint Designer 2007 and navigate to the page containing the Data Form Web Part. (follow the "Steps to Reproduce" above)
- In Code view,search for the following peace of code:
- Replace it with the following peace of code:
- Save the page.
That's it, now browse again to that page you have just modified, and see for yourself – Opening a file with apostrophe in it's name actually works.