XslCompiledTransform.Load Method (Type)


Loads the compiled style sheet that was created using the XSLT Compiler (xsltc.exe).

Namespace:   System.Xml.Xsl
Assembly:  System.Xml (in System.Xml.dll)

public void Load(
	Type compiledStylesheet


Type: System.Type

The name of the class that contains the compiled style sheet.

This is usually the name of the style sheet. Unless otherwise specified, the xsltc.exe tool uses the name of the style sheet for the class and assembly names.

The xsltc.exe tool is used to compile style sheets and generate assemblies from the style sheets. The Load method loads the compiled style sheet from the assembly.


You must also include the XSLT assembly as a reference in your application.

The following example shows how to load a compiled style sheet from an XSLT assembly. The example assumes that the xsltc.exe tool was used to create an assembly named bookOrders.dll with a class named bookOrders.


You have to reference the XSLT assembly when compiling the code. For example, csc /r:system.dll;system.xml.dll;bookOrders.dll myCode.cs.

// Load the type of the class.
XslCompiledTransform xslt = new XslCompiledTransform();

.NET Framework
Available since 2.0
Return to top