Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

How can I use CLR classes in XSLT extensions?

Please, does anyone knows how can I use some CLR classes in my XSLT extension function?
I'd like to do something like this:
<msxsl:script language="C#" implements-prefix="my">
<![CDATA[
public string description(string item){
  SqlConnection conn = new SqlConnection("...");
  conn.Open();
  // some database query
  return result;
}
]]>
</msxsl:script>
But there are lot of errors saying that I've forgotten an assembly reference.
So, the answer is: how can I add assembly reference?

Mikhail Andronov
Sunday, November 03, 2002

You'll need to add an XSLT Extension Object. Take a look at http://msdn.microsoft.com/msdnmag/issues/02/03/xml/default.aspx .

Mike Gunderloy
Sunday, November 03, 2002

Thanks a lot! Your link was really useful.

And... sorry for my English. :-)

Mikhail Andronov
Monday, November 04, 2002

*  Recent Topics

*  Fog Creek Home