XmlResolver Class

System.Xml

Resolves external XML resources, such as DTDs and entities. This is an abstract class.

Inheritance

Object
    System.Xml.XmlResolver

Remarks

The XmlResolver class is used to resolve Uniform Resource Identifiers (URIs) for external XML resources. This includes Document Type Definitions (DTDs), entities, and other external XML fragments. When an XML document parser encounters a reference to an external resource, it uses an instance of XmlResolver to locate and load that resource.

The .NET Framework provides a default implementation, XmlXapResolver, which is used when no custom resolver is specified. For security reasons, it's important to use XmlResolver implementations that are careful about the resources they load, to prevent potential denial-of-service attacks or other security vulnerabilities.

Custom implementations of XmlResolver can be created to provide specific resolution logic, such as resolving URIs from a network, a database, or a custom file system.

Methods

Member Type Description
GetEntity Object Resolves the given URI and returns an object that can be read to access the resource.
GetEntityAsync Task<Object> Asynchronously resolves the given URI and returns an object that can be read to access the resource.
ResolveEntity Object Resolves the DTD or entity indicated by the specified URN and URI.
ResolveEntityAsync Task<Object> Asynchronously resolves the DTD or entity indicated by the specified URN and URI.

Properties

Member Type Description
Credentials ICredentials Gets or sets a value indicating the credentials used to authenticate Web requests.

Methods inherited from System.Object

Member Type Description
Equals Boolean Determines whether the specified object is equal to the current object.
GetHashCode Int32 Serves as the default hash function.
GetType Type Gets the type of the current instance.
ReferenceEquals Boolean Determines whether the specified Object instances are the same instance.
ToString String Returns a string that represents the current object.