Redigera

Dela via


XslTransform.XmlResolver Property

Definition

Caution

You should pass XmlResolver to Transform() method

Sets the XmlResolver used to resolve external resources when the Transform method is called.

public:
 property System::Xml::XmlResolver ^ XmlResolver {  void set(System::Xml::XmlResolver ^ value); };
public System.Xml.XmlResolver? XmlResolver { set; }
public System.Xml.XmlResolver XmlResolver { set; }
[System.Obsolete("You should pass XmlResolver to Transform() method")]
public System.Xml.XmlResolver XmlResolver { set; }
member this.XmlResolver : System.Xml.XmlResolver
[<System.Obsolete("You should pass XmlResolver to Transform() method")>]
member this.XmlResolver : System.Xml.XmlResolver
Public Property XmlResolver As XmlResolver

Property Value

The XmlResolver to use during transformation. If set to null, the XSLT document() function is not resolved.

Attributes

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.

In version 1.1 of the .NET Framework, the trust level of the application determines the default behavior:

Fully trusted code: A default XmlUrlResolver with no user credentials is used to resolve the document() function. If authentication is required to access the external resource, use this property to specify an XmlResolver with the necessary credentials.

Semi-trusted code: The property is set to null, which means the document() function is not resolved. Because full trust is required to specify an XmlResolver, this property also cannot be set.

This resolver is used when the XSLT document() function is invoked. It is not used to resolve xsl:import and xsl:include elements referenced in the style sheet. To specify an XmlResolver to use to resolve xsl:import and xsl:include elements referenced in the style sheet, use the Load overload, which takes an XmlResolver as one of its arguments.

Note

This property is obsolete in version 1.1 of the .NET Framework. Specifying an XmlResolver using the Transform method is the recommended practice. In this case, the XmlResolver is not cached after the Transform method completes.

Applies to

See also