Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have been trying for days to understand why, following an upgrade to Sp2010, none of the statements used in my web part definitions are working. The work fine in SP Designer 2010 and render as before but displaying the web pages in a browser, they do not. What gets rendered appears to use data from the appropriate list (as defined in the web part) but using whatever the last valid stylesheet was rendered, which of course makes no sense. If I remove the import statement completely I get the same result so I can only assume the runtime is unable to find the included stylesheet? I have tried everything I can think of with no luck.

This is a major issue as the only solution I have is to copy all the stylesheet code back into their respective web parts (30+ pf them), which is such a retrograde step.

N.B. I have tried creating a web part page in an empty SP2010 site then putting the XSL template in an external .xsl file and trying to include it but have hit the same issue, so it doesn't appear to be an issue with the migrated site, rather, something in the site configurations of our SP2010 farm?

I would be so grateful for any help available.

share|improve this question
    
I'd recommend you to check SharePoint ULS logs, and post here the exception message or something like this. If stylesheet is not found, it must be an exception message. –  Andrey Markeev Oct 27 '11 at 12:05
    
Thanks for this. I don't have access to the logs but I'll check with our system admin guys. –  Tim Burraston Nov 1 '11 at 9:31
add comment

2 Answers

I've had issues using the xsl:import before when I am importing items that are in a SharePoint library. If I'm importing a file from the filesystem then I have no trouble; but from the Style Library for example I get an error about not being able to load the XSL file (in the ULS Logs).

If you are unable to deploy your XSL to the filesystem then I think the options would be to either keep the XSL in the web part (as it is by default when using SPD or perhaps to use the XSL Link property of the web parts (which can be set through the UI) to point to a re-usable XSL file in a SharePoint library.

My personal preference is to use the XSL Link property.

share|improve this answer
    
Thanks for the reply Glyn. I'm actually holding the xsl code in a folder in the site's file system. I'll try moving it somewhere else then, if that fails, try the xsl:link option. –  Tim Burraston Nov 1 '11 at 9:31
add comment

This might be way off but have you ensured that your tag is located in the web part code correctly? It's important that it's directly after the tag and won't work anywhere else.

Additionally, does your XSL file in the style library have the appropriate tag at the top?

ie:

<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema"
    xmlns:d="http://schemas.microsoft.com/sharepoint/dsp"
    version="1.0"
    exclude-result-prefixes="xsl msxsl ddwrt"
    xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
    xmlns:asp="http://schemas.microsoft.com/ASPNET/20"
    xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:SharePoint="Microsoft.SharePoint.WebControls"
    xmlns:ddwrt2="urn:frontpage:internal">
<xsl:output method="html" indent="no"/>
/* code */
</xsl:stylesheet>

These are two gotchas that have bitten me before.

share|improve this answer
    
Can you describe the first gotcha you refer to a bit more? I am having the same issue as the original author. –  spevilgenius Dec 27 '11 at 23:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.