Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Xml.​XmlResolver
Assembly: System.Xml.ReaderWriter
Inheritance: object → XmlResolver
Resolves external XML resources named by a Uniform Resource Identifier (URI).
Properties
Credentials
When overridden in a derived class, sets the credentials used to authenticate web requests.
public static
XmlResolver
ThrowingResolver
Gets an XML resolver that forbids entity resolution.
public static
XmlResolver
FileSystemResolver
Gets an XML resolver that resolves only file system URIs.
Methods
public
object
GetEntity​(Uri absoluteUri,
string role,
Type ofObjectToReturn)
When overridden in a derived class, maps a URI to an object that contains the actual resource.
Returns A stream object or <see langword="null" /> if a type other than stream is specified.
absoluteUri
The URI returned from <see cref="M:System.Xml.XmlResolver.ResolveUri(System.Uri,System.String)" /> .
role
Currently not used.
ofObjectToReturn
The type of object to return. The current version only returns System.IO.Stream objects.
public
Threading.​Tasks.​Task<​object>
GetEntityAsync​(Uri absoluteUri,
string role,
Type? ofObjectToReturn)
Asynchronously maps a URI to an object that contains the actual resource.
Returns A stream object or <see langword="null" /> if a type other than stream is specified.
absoluteUri
The URI returned from <see cref="M:System.Xml.XmlResolver.ResolveUri(System.Uri,System.String)" /> .
role
Currently not used.
ofObjectToReturn
The type of object to return. The current version only returns <see cref="T:System.IO.Stream" /> objects.
public
Uri
ResolveUri​(Uri baseUri,
string relativeUri)
When overridden in a derived class, resolves the absolute URI from the base and relative URIs.
Returns The absolute URI or <see langword="null" /> if the relative URI cannot be resolved.
baseUri
The base URI used to resolve the relative URI.
relativeUri
The URI to resolve. The URI can be absolute or relative. If absolute, this value effectively replaces the <paramref name="baseUri" /> value. If relative, it combines with the <paramref name="baseUri" /> to make an absolute URI.
public
bool
SupportsType​(Uri absoluteUri,
Type? type)
Enables the resolver to return types other than <see cref="T:System.IO.Stream" /> .
Returns <see langword="true" /> if the <paramref name="type" /> is supported; otherwise, <see langword="false" /> .
absoluteUri
The URI.
type
The type to return.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object