XslCompiledTransform::Load Method (String^, XsltSettings^, XmlResolver^)
Loads and compiles the XSLT style sheet specified by the URI. The XmlResolver resolves any XSLT import or include elements and the XSLT settings determine the permissions for the style sheet.
Assembly: System.Xml (in System.Xml.dll)
public: void Load( String^ stylesheetUri, XsltSettings^ settings, XmlResolver^ stylesheetResolver )
Parameters
- stylesheetUri
-
Type:
System::String^
The URI of the style sheet.
- settings
-
Type:
System.Xml.Xsl::XsltSettings^
The XsltSettings to apply to the style sheet. If this is null, the Default setting is applied.
- stylesheetResolver
-
Type:
System.Xml::XmlResolver^
The XmlResolver used to resolve the style sheet URI and any style sheets referenced in XSLT import and include elements.
| Exception | Condition |
|---|---|
| ArgumentNullException | The stylesheetUri or stylesheetResolver value is null. |
| XsltException | The style sheet contains an error. |
| FileNotFoundException | The style sheet cannot be found. |
| DirectoryNotFoundException | The stylesheetUri value includes a filename or directory that cannot be found. |
| WebException | The stylesheetUri value cannot be resolved. -or- An error occurred while processing the request. |
| UriFormatException | stylesheetUri is not a valid URI. |
| XmlException | There was a parsing error loading the style sheet. |
The XslCompiledTransform class supports the XSLT 1.0 syntax. The XSLT style sheet must use the http://www.w3.org/1999/XSL/Transform namespace.
An XmlReader with default settings is used to load the style sheet. DTD processing is disabled on the XmlReader. If you require DTD processing, create an XmlReader with this feature enabled, and pass it to the Load method.
The following example loads a style sheet that is stored on a network resource. An XmlSecureResolver object specifies the credentials necessary to access the style sheet.
Available since 2.0