Edit

XslTransform.Load Method

Definition

Loads the XSLT style sheet, including style sheets referenced in xsl:include and xsl:import elements.

Overloads

Name Description
Load(IXPathNavigable, XmlResolver)

Loads the XSLT style sheet contained in the IXPathNavigable.

Load(XmlReader, XmlResolver)

Loads the XSLT style sheet contained in the XmlReader.

Load(String, XmlResolver)

Loads the XSLT style sheet specified by a URL.

Load(XPathNavigator, XmlResolver)

Loads the XSLT style sheet contained in the XPathNavigator.

Load(IXPathNavigable)

Loads the XSLT style sheet contained in the IXPathNavigable.

Load(XmlReader)

Loads the XSLT style sheet contained in the XmlReader.

Load(String)

Loads the XSLT style sheet specified by a URL.

Load(XPathNavigator)

Loads the XSLT style sheet contained in the XPathNavigator.

Remarks

Note

The XslTransform class is obsolete in the .NET Framework version 2.0. The XslCompiledTransform class is the new XSLT processor. For more information, see Using the XslCompiledTransform Class and Migrating From the XslTransform Class.

Load(IXPathNavigable, XmlResolver)

Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs

Loads the XSLT style sheet contained in the IXPathNavigable.

public:
 void Load(System::Xml::XPath::IXPathNavigable ^ stylesheet, System::Xml::XmlResolver ^ resolver);
public void Load(System.Xml.XPath.IXPathNavigable stylesheet, System.Xml.XmlResolver? resolver);
public void Load(System.Xml.XPath.IXPathNavigable stylesheet, System.Xml.XmlResolver resolver);
member this.Load : System.Xml.XPath.IXPathNavigable * System.Xml.XmlResolver -> unit
Public Sub Load (stylesheet As IXPathNavigable, resolver As XmlResolver)

Parameters

stylesheet
IXPathNavigable

An object implementing the IXPathNavigable interface. In the .NET Framework, this can be either an XmlNode (typically an XmlDocument), or an XPathDocument containing the XSLT style sheet.

resolver
XmlResolver

The XmlResolver used to load any style sheets referenced in xsl:import and xsl:include elements. If this is null, external resources are not resolved.

The XmlResolver is not cached after the Load method completes.

Exceptions

The loaded resource is not a valid style sheet.

The style sheet contains embedded scripts, and the caller does not have UnmanagedCode permission.

Remarks

Note

The XslTransform class is obsolete in the .NET Framework version 2.0. The XslCompiledTransform class is the new XSLT processor. For more information, see Using the XslCompiledTransform Class and Migrating From the XslTransform Class.

XslTransform supports the XSLT 1.0 syntax. The XSLT style sheet must include the namespace declaration xmlns:xsl= http://www.w3.org/1999/XSL/Transform.

If the style sheet contains embedded scripting, the script is compiled to an assembly. The assembly has full trust. The recommended practice is to provide evidence using the Load(IXPathNavigable, XmlResolver, Evidence) method.

Note

If the caller does not have UnmanagedCode permission, the embedded script is not compiled and a SecurityException is thrown. See SecurityPermission and SecurityPermissionFlag.UnmanagedCode for more information.

See also

Applies to

Load(XmlReader, XmlResolver)

Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs

Loads the XSLT style sheet contained in the XmlReader.

public:
 void Load(System::Xml::XmlReader ^ stylesheet, System::Xml::XmlResolver ^ resolver);
public void Load(System.Xml.XmlReader stylesheet, System.Xml.XmlResolver? resolver);
public void Load(System.Xml.XmlReader stylesheet, System.Xml.XmlResolver resolver);
member this.Load : System.Xml.XmlReader * System.Xml.XmlResolver -> unit
Public Sub Load (stylesheet As XmlReader, resolver As XmlResolver)

Parameters

stylesheet
XmlReader

An XmlReader object that contains the XSLT style sheet.

resolver
XmlResolver

The XmlResolver used to load any style sheets referenced in xsl:import and xsl:include elements. If this is null, external resources are not resolved.

The XmlResolver is not cached after the Load(XmlReader, XmlResolver) method completes.

Exceptions

The current node does not conform to a valid style sheet.

The style sheet contains embedded scripts, and the caller does not have UnmanagedCode permission.

Remarks

Note

The XslTransform class is obsolete in the .NET Framework version 2.0. The XslCompiledTransform class is the new XSLT processor. For more information, see Using the XslCompiledTransform Class and Migrating From the XslTransform Class.

XslTransform supports the XSLT 1.0 syntax. The XSLT style sheet must include the namespace declaration xmlns:xsl= http://www.w3.org/1999/XSL/Transform.

This method loads the XSLT style sheet, including any style sheets referenced in xsl:include and xsl:import elements. The style sheet loads from the current node of the XmlReader through all its children. This enables you to use a portion of a document as the style sheet.

After the Load method returns, the XmlReader is positioned on the next node after the end of the style sheet. If the end of the document is reached, the XmlReader is positioned at the end of file (EOF).

If the style sheet contains entities, you should specify an XmlReader that can resolve entities (XmlReader.CanResolveEntity returns true). In this case, an XmlValidatingReader can be used.

If the style sheet contains embedded scripting, the script is compiled to an assembly. The assembly has full trust. The recommended practice is to provide evidence using the Load(XmlReader, XmlResolver, Evidence) method.

Note

If the caller does not have UnmanagedCode permission, the embedded script is not compiled and a SecurityException is thrown. See SecurityPermission and SecurityPermissionFlag.UnmanagedCode for more information.

See also

Applies to

Load(String, XmlResolver)

Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs

Loads the XSLT style sheet specified by a URL.

public:
 void Load(System::String ^ url, System::Xml::XmlResolver ^ resolver);
public void Load(string url, System.Xml.XmlResolver? resolver);
public void Load(string url, System.Xml.XmlResolver resolver);
member this.Load : string * System.Xml.XmlResolver -> unit
Public Sub Load (url As String, resolver As XmlResolver)

Parameters

url
String

The URL that specifies the XSLT style sheet to load.

resolver
XmlResolver

The XmlResolver to use to load the style sheet and any style sheet(s) referenced in xsl:import and xsl:include elements.

If this is null, a default XmlUrlResolver with no user credentials is used to open the style sheet. The default XmlUrlResolver is not used to resolve any external resources in the style sheet, so xsl:import and xsl:include elements are not resolved.

The XmlResolver is not cached after the Load(String, XmlResolver) method completes.

Exceptions

The loaded resource is not a valid style sheet.

The style sheet contains embedded script, and the caller does not have UnmanagedCode permission.

Remarks

Note

The XslTransform class is obsolete in the .NET Framework version 2.0. The XslCompiledTransform class is the new XSLT processor. For more information, see Using the XslCompiledTransform Class and Migrating From the XslTransform Class.

XslTransform supports the XSLT 1.0 syntax. The XSLT style sheet must include the namespace declaration xmlns:xsl= http://www.w3.org/1999/XSL/Transform.

If the style sheet contains embedded scripting, the script is compiled to an assembly. The URI of the style sheet is used to create evidence, which is applied to the assembly.

Note

If the caller does not have UnmanagedCode permission, the embedded script is not compiled and a SecurityException is thrown. See SecurityPermission and SecurityPermissionFlag.UnmanagedCode for more information.

See also

Applies to

Load(XPathNavigator, XmlResolver)

Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs

Loads the XSLT style sheet contained in the XPathNavigator.

public:
 void Load(System::Xml::XPath::XPathNavigator ^ stylesheet, System::Xml::XmlResolver ^ resolver);
public void Load(System.Xml.XPath.XPathNavigator stylesheet, System.Xml.XmlResolver? resolver);
public void Load(System.Xml.XPath.XPathNavigator stylesheet, System.Xml.XmlResolver resolver);
member this.Load : System.Xml.XPath.XPathNavigator * System.Xml.XmlResolver -> unit
Public Sub Load (stylesheet As XPathNavigator, resolver As XmlResolver)

Parameters

stylesheet
XPathNavigator

An XPathNavigator object that contains the XSLT style sheet.

resolver
XmlResolver

The XmlResolver used to load any style sheets referenced in xsl:import and xsl:include elements. If this is null, external resources are not resolved.

The XmlResolver is not cached after the Load method completes.

Exceptions

The current node does not conform to a valid style sheet.

The style sheet contains embedded scripts, and the caller does not have UnmanagedCode permission.

Remarks

Note

The XslTransform class is obsolete in the .NET Framework version 2.0. The XslCompiledTransform class is the new XSLT processor. For more information, see Using the XslCompiledTransform Class and Migrating From the XslTransform Class.

XslTransform supports the XSLT 1.0 syntax. The XSLT style sheet must include the namespace declaration xmlns:xsl= http://www.w3.org/1999/XSL/Transform.

The style sheet is loaded from the current position of the XPathNavigator. To use a portion of the loaded document as the style sheet, navigate to the node corresponding to the beginning of the style sheet. After the Load method returns, the XPathNavigator is positioned at the beginning of the style sheet (on the xsl:style sheet node).

If the style sheet contains embedded scripting, the script is compiled to an assembly. The assembly has full trust. The recommended practice is to provide evidence using the Load(XPathNavigator, XmlResolver, Evidence).

Note

If the caller does not have UnmanagedCode permission, the embedded script is not compiled and a SecurityException is thrown. See SecurityPermission and SecurityPermissionFlag.UnmanagedCode for more information.

See also

Applies to

Load(IXPathNavigable)

Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs

Loads the XSLT style sheet contained in the IXPathNavigable.

public:
 void Load(System::Xml::XPath::IXPathNavigable ^ stylesheet);
public void Load(System.Xml.XPath.IXPathNavigable stylesheet);
member this.Load : System.Xml.XPath.IXPathNavigable -> unit
Public Sub Load (stylesheet As IXPathNavigable)

Parameters

stylesheet
IXPathNavigable

An object implementing the IXPathNavigable interface. In the .NET Framework, this can be either an XmlNode (typically an XmlDocument), or an XPathDocument containing the XSLT style sheet.

Exceptions

The loaded resource is not a valid style sheet.

The style sheet contains embedded scripts, and the caller does not have UnmanagedCode permission.

Remarks

Note

The XslTransform class is obsolete in the .NET Framework version 2.0. The XslCompiledTransform class is the new XSLT processor. For more information, see Using the XslCompiledTransform Class and Migrating From the XslTransform Class.

XslTransform supports the XSLT 1.0 syntax. The XSLT style sheet must include the namespace declaration xmlns:xsl= http://www.w3.org/1999/XSL/Transform.

This method loads the XSLT style sheet, including any style sheets referenced in xsl:include and xsl:import elements. External resources are resolved using an XmlUrlResolver with no user credentials. If the style sheet(s) are located on a network resource that requires authentication, use the overload that takes an XmlResolver as one of its arguments and specify an XmlResolver with the necessary credentials.

If the style sheet contains embedded scripting, the script is compiled to an assembly. The assembly has full trust. The recommended practice is to provide evidence using the Load(IXPathNavigable, XmlResolver, Evidence) method.

Note

If the caller does not have UnmanagedCode permission, the embedded script is not compiled and a SecurityException is thrown. See SecurityPermission and SecurityPermissionFlag.UnmanagedCode for more information.

Applies to

Load(XmlReader)

Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs

Loads the XSLT style sheet contained in the XmlReader.

public:
 void Load(System::Xml::XmlReader ^ stylesheet);
public void Load(System.Xml.XmlReader stylesheet);
member this.Load : System.Xml.XmlReader -> unit
Public Sub Load (stylesheet As XmlReader)

Parameters

stylesheet
XmlReader

An XmlReader object that contains the XSLT style sheet.

Exceptions

The current node does not conform to a valid style sheet.

The style sheet contains embedded scripts, and the caller does not have UnmanagedCode permission.

Remarks

Note

The XslTransform class is obsolete in the .NET Framework version 2.0. The XslCompiledTransform class is the new XSLT processor. For more information, see Using the XslCompiledTransform Class and Migrating From the XslTransform Class.

XslTransform supports the XSLT 1.0 syntax. The XSLT style sheet must include the namespace declaration xmlns:xsl= http://www.w3.org/1999/XSL/Transform.

This method loads the XSLT style sheet, including any style sheets referenced in xsl:include and xsl:import elements. External resources are resolved using an XmlUrlResolver with no user credentials. If the style sheet(s) are located on a network resource that requires authentication, use the overload that takes an XmlResolver as one of its arguments and specify an XmlResolver with the necessary credentials.

The style sheet loads from the current node of the XmlReader through all its children. This enables you to use a portion of a document as the style sheet. After the Load method returns, the XmlReader is positioned on the next node after the end of the style sheet. If the end of the document is reached, the XmlReader is positioned at the end of file (EOF).

If the style sheet contains entities, you should specify an XmlReader that can resolve entities (XmlReader.CanResolveEntity returns true). In this case, an XmlValidatingReader can be used.

If the style sheet contains embedded scripting, the script is compiled to an assembly. The assembly has full trust. The recommended practice is to provide evidence using the Load(XmlReader, XmlResolver, Evidence) method.

Note

If the caller does not have UnmanagedCode permission, the embedded script is not compiled and a SecurityException is thrown. See SecurityPermission and SecurityPermissionFlag.UnmanagedCode for more information.

Applies to

Load(String)

Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs

Loads the XSLT style sheet specified by a URL.

public:
 void Load(System::String ^ url);
public void Load(string url);
member this.Load : string -> unit
Public Sub Load (url As String)

Parameters

url
String

The URL that specifies the XSLT style sheet to load.

Exceptions

The loaded resource is not a valid style sheet.

The style sheet contains embedded script, and the caller does not have UnmanagedCode permission.

Remarks

Note

The XslTransform class is obsolete in the .NET Framework version 2.0. The XslCompiledTransform class is the new XSLT processor. For more information, see Using the XslCompiledTransform Class and Migrating From the XslTransform Class.

XslTransform supports the XSLT 1.0 syntax. The XSLT style sheet must include the namespace declaration xmlns:xsl="http://www.w3.org/1999/XSL/Transform".

This method loads the XSLT style sheet, including any style sheets referenced in xsl:include and xsl:import elements. External resources are resolved using an XmlUrlResolver with no user credentials. If the style sheet(s) are located on a network resource that requires authentication, use the overload that takes an XmlResolver as one of its arguments and specify an XmlResolver with the necessary credentials.

If the style sheet contains embedded scripting, the script is compiled to an assembly. The URI of the style sheet is used to create evidence, which is applied to the assembly.

Note

If the caller does not have UnmanagedCode permission, the embedded script is not compiled and a SecurityException is thrown. See SecurityPermission and SecurityPermissionFlag.UnmanagedCode for more information.

Applies to

Load(XPathNavigator)

Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs
Source:
XslTransform.cs

Loads the XSLT style sheet contained in the XPathNavigator.

public:
 void Load(System::Xml::XPath::XPathNavigator ^ stylesheet);
public void Load(System.Xml.XPath.XPathNavigator stylesheet);
member this.Load : System.Xml.XPath.XPathNavigator -> unit
Public Sub Load (stylesheet As XPathNavigator)

Parameters

stylesheet
XPathNavigator

An XPathNavigator object that contains the XSLT style sheet.

Exceptions

The current node does not conform to a valid style sheet.

The style sheet contains embedded scripts, and the caller does not have UnmanagedCode permission.

Remarks

Note

The XslTransform class is obsolete in the .NET Framework version 2.0. The XslCompiledTransform class is the new XSLT processor. For more information, see Using the XslCompiledTransform Class and Migrating From the XslTransform Class.

XslTransform supports the XSLT 1.0 syntax. The XSLT style sheet must include the namespace declaration xmlns:xsl= http://www.w3.org/1999/XSL/Transform.

This method loads the XSLT style sheet, including any style sheets referenced in xsl:include and xsl:import elements. External resources are resolved using an XmlUrlResolver with no user credentials. If the style sheet(s) are located on a network resource that requires authentication, use the overload that takes an XmlResolver as one of its arguments and specify an XmlResolver with the necessary credentials.

The style sheet is loaded from the current position of the XPathNavigator. To use just a portion of the loaded document as the style sheet, navigate to the node corresponding to the beginning of the style sheet. After the Load method returns, the XPathNavigator is positioned at the beginning of the style sheet (on the xsl:style sheet node).

If the style sheet contains embedded scripting, the script is compiled to an assembly. The assembly has full trust. The recommended practice is to provide evidence using the Load(XPathNavigator, XmlResolver, Evidence) method.

Note

If the caller does not have UnmanagedCode permission, the embedded script is not compiled and a SecurityException is thrown. See SecurityPermission and SecurityPermissionFlag.UnmanagedCode for more information.

Applies to