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 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; }

Property Value

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

Attributes

Remarks

참고

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.

참고

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

제품 버전 (사용되지 않음)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 (1.1)
.NET Standard 2.0, 2.1

See also