XsltArgumentList args = new XsltArgumentList(); args.AddParam("message", "", "Hello World!"); XslCompiledTransform xslt = new XslCompiledTransform(); xslt.Load("transform.xslt"); xslt.Transform("input.xml", args, Console.Out);
XsltArgumentList args = new XsltArgumentList(); args.AddExtensionObject("my-ns", new MyExtensionObject()); XslCompiledTransform xslt = new XslCompiledTransform(); xslt.Load("transform.xslt"); xslt.Transform("input.xml", args, Console.Out);This code creates an XsltArgumentList object and adds an extension object called "my-ns" that provides access to custom functions and variables defined in an external assembly. The XSLT transformation is loaded from a file called "transform.xslt" and applied to an XML file called "input.xml". The output is written to the console, which may include values computed by the custom functions and variables. The System.Xml.Xsl namespace is part of the .NET Framework Class Library, which is a package of libraries that provide common functionality for .NET applications.