Data form webpart xsl link

Hello,

I am inserting a blank Data View into an aspx sharepoint page, then linking it to a data source and a custom xsl file. I am able to browse to the location of the xsl file and select it. The xsl file is in a parent web site. This is what the code looks like for the link as generated by SharePoint Designer:

<XslLink>
../../../SiteAssets/xml/teamProfiles.xslt</XslLink>

However, after I save the file without doing anything, this is what I get after the save:

<XslLink>
SiteAssets/xml/teamProfiles.xslt</XslLink>

As you can see, SharePoint stripped off the first part of the path which causes it to not be able to find the xsl file which results in an error when trying to display the page. I have also tried putting an absolute URL (this is before saving):

<XslLink>
/sites/mysite/SiteAssets/xml/teamProfiles.xslt</XslLink>

Which gets modified to this after the save:

<XslLink>
sites/mysite/SiteAssets/xml/teamProfiles.xslt</XslLink>

Which again is an incorrect path and causes an error because the xsl file does not exist with that path. However, if I manually take out the new line character right before the path as such:

<XslLink>/sites/mysite/SiteAssets/xml/teamProfiles.xslt</XslLink>

Then after the save, the data view displays correctly. However, for some reason, after saving this code, SharePoint does modify it by putting another new line at the beginning of the path, which results in this:

<XslLink>
/sites/mysite/SiteAssets/xml/teamProfiles.xslt</XslLink>

This is still okay, but as soon as I save it again, I get this:

<XslLink>
sites/mysite/SiteAssets/xml/teamProfiles.xslt</XslLink>

This seems like very odd behavior. Is there anyway to work around this, or is this a bug? I am using SharePoint 2010 with SharePoint Designer 2010.

I have tried this in SharePoint's web-based editor and it doesn't seem to cause this problem.

Has anybody else run into this problem or know how to fix it or know if it is fixed in the new SharePoint?

Thanks,

July 3rd, 2013 3:03pm

Hi Kevin,

This is expected behavior. Each time when we save the page with a DVWP on it, the file in the XslLink will also being saved as Embedded Files, so the XslLink always changed here.

The resolution has been provided by Marc blog. We can select Dont overwrite the existing file. Make the page refer to the existing file by clicking Set Action in Save Embedded Files window. For more details, please visit Marcs blog from below link.
http://sympmarc.com/2010/04/21/xsllink-vs-xslimport-in-data-view-web-parts-dvwps/

Thanks & Regards,
Emir

Free Windows Admin Tool Kit Click here and download it now
July 4th, 2013 4:23am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics