1

I have an XSLT with a C# script in it:

<msxsl:script language="C#" implements-prefix="user">
  <msxsl:using namespace="System.Xml"/>
  <msxsl:using namespace="System.Xml.XPath"/>
  <![CDATA[
    public string GetMenuPath(XPathNodeIterator node)
    {       
      XPathNavigator dataSourceNode = node.Current;
      return dataSourceNode.Name;
    }
  ]]>
</msxsl:script>

And somewhere in the XSLT this function is called:

<xsl:value-of select="user:GetMenuPath(current())"/>

But as I try to run the XSLT transformation on the XML input (the input does not matter), it stop immediately with the error "msxsl:script cannot be empty".

I have absolutely no idea why... I use nxslt with .NET Framework.

Thank you for help !

3 Answers 3

1

Thank you for your answers, I found out the origin of the problem now. It was because I was using the "style" tag instead of "nxslt" for calling the XSLT transformation. "style" works as long as there is no extension script.

<nxslt style="transformation.xsl" in="input.xml" out="output.xls" verbose="true">
Sign up to request clarification or add additional context in comments.

Comments

0

Does it give you the line that the transformation stops on? Is it where it is calling from or in the script tag?

1 Comment

No, so I tried to run it with the XSLT debugger of Visual Studio, and the transformation worked !
0

Have you tried putting your extension method into a separate assembly and referencing it that way?

Marc

1 Comment

No, but this was not the cause, since it worked when running it in Visual Studio. But I found it out now !

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.