This topic has not yet been rated - Rate this topic

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
)

Parameters

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.

Note Note

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.

Note Note

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();
xslt.Load(typeof(bookOrders));

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ