Export (0) Print
Expand All

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

Supported in: 4.6, 4.5, 4, 3.5 SP1, 3.0 SP1, 2.0 SP1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft