0

I am using xslt functions from MSXLT

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
...
<xsl:value-of select="msxsl:format-date(/article/createDate, 'dd/MM')"/>

This works when debugging in VS, but when I run it in a web app, it fails: 'cannot find the script or external object that implements prefix msxsl'. Am I missing a reference in my web project?

Thanks for any help

Ryan

Dimitre Novatchev
  • 240,661
  • 26
  • 293
  • 431
Ryan
  • 3,924
  • 6
  • 46
  • 69

1 Answers1

2

Ah, the trick is to use XSLTCompiledTransform, not XsltTranform in the C# code:

        XslCompiledTransform myXslTrans = new XslCompiledTransform();
        XsltSettings settings = new XsltSettings();
        settings.EnableScript = true;
        myXslTrans.Load(article.XslPath, settings, null);

Does the trick

Ryan
  • 3,924
  • 6
  • 46
  • 69