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

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.