A bit of SharePoint XSLT magic
September 13, 2011
Stumbled upon another example of SharePoint magic in XSLT today.
Was trying to insert a link to a themable css into my XSLT. Written following code:
<xsl:template match="/">
<SharePoint:CssRegistration runat="server" Name="/Style Library/Themable/Test.css" EnableCssTheming="True" />
</xsl:template>
And got following error:
A very vague description, isn't it?
Type 'Microsoft.SharePoint.WebControls.CssRegistration' does not have a public property named 'xmlns:SharePoint'.
After several tries, ended up with following working code:
<xsl:template match="/">
<span>
<SharePoint:CssRegistration runat="server" Name="/Style Library/Themable/Test.css" EnableCssTheming="True" />
</span>
</xsl:template>
Find the difference! :) It's the magic, definitely...