XslCompiledTransform::Load Method (MethodInfo^, array<Byte>^, array<Type^>^)

 

Loads a method from a style sheet compiled using the XSLTC.exe utility.

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

public:
void Load(
	MethodInfo^ executeMethod,
	array<unsigned char>^ queryData,
	array<Type^>^ earlyBoundTypes
)

Parameters

executeMethod
Type: System.Reflection::MethodInfo^

A MethodInfo object representing the compiler-generated execute method of the compiled style sheet.

queryData
Type: array<System::Byte>^

A byte array of serialized data structures in the staticData field of the compiled style sheet as generated by the CompileToType method.

earlyBoundTypes
Type: array<System::Type^>^

An array of types stored in the compiler-generated ebTypes field of the compiled style sheet.

This method accepts a compiled style sheet in the form of a MethodInfo object, a byte array, and a type array. DynamicMethod objects may be used to allow compiled style sheet methods to be discarded when the XslCompiledTransform object is reclaimed.

The code example below uses the Load to load a compiled style sheet. The transformation reduces the value of the Price element by ten percent.

No code example is currently available or this language may not be supported.
System_CAPS_noteNote

The "Transform" assembly used in this example was built using the xsltc.exe utility. For detailed information on using this command line tool, see How to: Perform an XSLT Transformation by Using an Assembly.

The code example above uses the following transformation:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  xmlns:user="urn:my-scripts">
  <msxsl:script language="C#" implements-prefix="user">
    <![CDATA[
  public double modifyPrice(double price){
    price*=0.9;
    return price;
  }
  ]]>
  </msxsl:script>
  <xsl:template match="Root">
    <Root xmlns="">
      <Price><xsl:value-of select="user:modifyPrice(Price)"/></Price>
    </Root>
  </xsl:template>
</xsl:stylesheet>

.NET Framework
Available since 2.0
Return to top
Show: