DataViewWebPart and the mysterious tabs

I've been working a lot recently with the DataView web part and ran into a problem today.  I tried to open my webpartpage that contains a DataViewWebPart in SharePoint Designer.  It opened, but SharePoint Designer ate a lot of processor and was responding very slowly.  I put my cursor in code view and tried to scroll and the Designer froze up.  After 15 minutes it still wasn't responding and I had to end it.  I tried again, rebooted, tried again, and finally decided to do some more investigation.  I requested the page from SharePoint in my browser and got the 'Unexpected Error…'.  I opened the Document Library in Explorer view and copied my page to local disk.  First thing I noticed: the page was 8.2MB.  ??? All it had was one DataView webpart (it was a test page).  I opened it in notepad, and guess what… notepad froze too.  Good thing I had version history turned on… I looked at the versions and noticed that the size of my page was doubling with each version.  ??? I opened one that was only 400KB in size and noticed the problem immediately.  In the middle of my Xsl for the DataView web part there were 1000's of blank lines.  The lines were composed of 3 tab characters each.  In the bigger files there were 3 or 4 sections of 20'000+ of these lines.  For whatever reason (I don't know if I want to know or not) SharePoint Designer was adding these lines to the dvt_1.toolbar template in my Xsl when I clicked the Save button.  Now, periodically between saves, I check the Xsl for these large chunks of whitespace and delete them.

Just a word of caution if you'll be saving your DataView web part repeatedly, don't let it get bloated.

Leave a Reply