This documentation is archived and is not being maintained.

XslTransform.Load Method

Loads the XSLT stylesheet including stylesheets referenced in xsl:include and xsl:import elements.

Note   If you are upgrading from .NET Framework version 1.0, see XslTransform Class Implements the XSLT Processor for migration information.

Overload List

Obsolete. Loads the XSLT stylesheet contained in the IXPathNavigable.

[Visual Basic] Overloads Public Sub Load(IXPathNavigable)
[C#] public void Load(IXPathNavigable);
[C++] public: void Load(IXPathNavigable*);
[JScript] public function Load(IXPathNavigable);

Loads the XSLT stylesheet specified by a URL.

[Visual Basic] Overloads Public Sub Load(String)
[C#] public void Load(string);
[C++] public: void Load(String*);
[JScript] public function Load(String);

Obsolete. Loads the XSLT stylesheet contained in the XmlReader.

[Visual Basic] Overloads Public Sub Load(XmlReader)
[C#] public void Load(XmlReader);
[C++] public: void Load(XmlReader*);
[JScript] public function Load(XmlReader);

Obsolete. Loads the XSLT stylesheet contained in the XPathNavigator.

[Visual Basic] Overloads Public Sub Load(XPathNavigator)
[C#] public void Load(XPathNavigator);
[C++] public: void Load(XPathNavigator*);
[JScript] public function Load(XPathNavigator);

Obsolete. Loads the XSLT stylesheet contained in the IXPathNavigable.

[Visual Basic] Overloads Public Sub Load(IXPathNavigable, XmlResolver)
[C#] public void Load(IXPathNavigable, XmlResolver);
[C++] public: void Load(IXPathNavigable*, XmlResolver*);
[JScript] public function Load(IXPathNavigable, XmlResolver);

Loads the XSLT stylesheet specified by a URL.

[Visual Basic] Overloads Public Sub Load(String, XmlResolver)
[C#] public void Load(string, XmlResolver);
[C++] public: void Load(String*, XmlResolver*);
[JScript] public function Load(String, XmlResolver);

Obsolete. Loads the XSLT stylesheet contained in the XmlReader.

[Visual Basic] Overloads Public Sub Load(XmlReader, XmlResolver)
[C#] public void Load(XmlReader, XmlResolver);
[C++] public: void Load(XmlReader*, XmlResolver*);
[JScript] public function Load(XmlReader, XmlResolver);

Obsolete. Loads the XSLT stylesheet contained in the XPathNavigator.

[Visual Basic] Overloads Public Sub Load(XPathNavigator, XmlResolver)
[C#] public void Load(XPathNavigator, XmlResolver);
[C++] public: void Load(XPathNavigator*, XmlResolver*);
[JScript] public function Load(XPathNavigator, XmlResolver);

Loads the XSLT stylesheet contained in the IXPathNavigable. This method allows you to limit the permissions of the stylesheet by specifying evidence.

[Visual Basic] Overloads Public Sub Load(IXPathNavigable, XmlResolver, Evidence)
[C#] public void Load(IXPathNavigable, XmlResolver, Evidence);
[C++] public: void Load(IXPathNavigable*, XmlResolver*, Evidence*);
[JScript] public function Load(IXPathNavigable, XmlResolver, Evidence);

Loads the XSLT stylesheet contained in the XmlReader. This method allows you to limit the permissions of the stylesheet by specifying evidence.

[Visual Basic] Overloads Public Sub Load(XmlReader, XmlResolver, Evidence)
[C#] public void Load(XmlReader, XmlResolver, Evidence);
[C++] public: void Load(XmlReader*, XmlResolver*, Evidence*);
[JScript] public function Load(XmlReader, XmlResolver, Evidence);

Loads the XSLT stylesheet contained in the XPathNavigator. This method allows you to limit the permissions of the stylesheet by specifying evidence.

[Visual Basic] Overloads Public Sub Load(XPathNavigator, XmlResolver, Evidence)
[C#] public void Load(XPathNavigator, XmlResolver, Evidence);
[C++] public: void Load(XPathNavigator*, XmlResolver*, Evidence*);
[JScript] public function Load(XPathNavigator, XmlResolver, Evidence);

Example

[Visual Basic, C#, C++] The following example performs an XSLT transform using a stylesheet from an outside source. Because the stylesheet comes from an untrusted source, the resolver and evidence parameters are set to a null reference (Nothing in Visual Basic).

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of Load. For other examples that might be available, see the individual overload topics.
[Visual Basic] 

   public shared sub TransformFile (xsltNav as XPathNavigator) 
    
    ' Load the stylesheet.
    Dim xslt as XslTransform = new XslTransform()
    xslt.Load(xsltNav, nothing, nothing)

    ' Transform the file.
    xslt.Transform("books.xml", "books.html", nothing)
   end sub

[C#] 

   public static void TransformFile (XPathNavigator xsltNav) {
    
    // Load the stylesheet. 
    XslTransform xslt = new XslTransform();
    xslt.Load(xsltNav, null, null);

    // Transform the file.
    xslt.Transform("books.xml", "books.html", null);
   } 

[C++] 

void TransformFile (XPathNavigator* xsltNav) {

    // Load the stylesheet. 
    XslTransform* xslt = new XslTransform();
    xslt->Load(xsltNav, 0, 0);

    // Transform the file.
    xslt->Transform(S"books.xml", S"books.html", 0);
} 

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

XslTransform Class | XslTransform Members | System.Xml.Xsl Namespace

Show: