views:

28

answers:

3

I am writing dot net code within my XSLT. It gives me below error when I call any namespace OR write "using" directive within XSLT.

Error- "Could not recognize 'com.myassembly' "

Is it possible to use any assembly within xslt?

+1  A: 

It is possible, and you need to use extension objects - you will have to pass these in to the xslt processor before you can use them in the xsl file.

See the examples here.

Oded
+1  A: 

Read about:

<msxsl:using>

<msxsl:assembly>

Dimitre Novatchev
I have used the below code-<msxsl:script language="C#" implements-prefix="callCode"><msxsl:using namespace="global::com.myassembly.crs.app.services.contentTypes"/> <![CDATA[ public int GetValue() { Test1 t = new Test1(); return t.GetValue(); } ]]> </msxsl:script>Get this error-**The type or namespace name 'com' could not be found in the global namespace (are you missing an assembly reference?)**
contactkx
@contactkx: according to source linked by Dimitre, you need to reference the assembly too.
Alejandro