Passing arguments into XSLT transformations with .NET

Created 18 October 2005 00:00
If you were using C#, you would add an argument to your transformation with the following code:
  XsltArgumentList arguments = new XsltArgumentList();
  arguments.AddParam("arg_name", "", "arg_value");
  xslt.Transform(xmlDoc, arguments, str, null);

Using the values passed in is simple, all you need to do is declare the parameter and refer to the parameter with the name prefixed with a "$":

  <xsl:param name="arg_name" />

  <xsl:value-of select="$arg_name" />