public abstract class XmlResolver
Object
XmlResolver
System.Xml
XML
Resolves external XML resources named by a URI.
This class is used to resolve external XML resources such as entities, document type definitions (DTDs), or schemas. It is also used to process include and import elements found in Extensible StyleSheet Language (XSL) stylesheets or XML Schema Definition language (XSD) schemas.This class is
abstract
and implemented in the XmlUrlResolver class.
System.Xml Namespace
XmlResolver Constructors
XmlResolver Methods
XmlResolver.GetEntity Method
XmlResolver.ResolveUri Method
XmlResolver Properties
protected XmlResolver();
Constructs a new instance of the XmlResolver class.
System.Xml.XmlResolver Class, System.Xml Namespace
public abstract object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn);
Maps a URI to an object containing the actual resource that the URI represents.
- absoluteUri
- An instance of the Uri class containing an absolute URI.
- role
- A String containing the
xlink:role
, or used as an implementation specific argument in other scenarios.- ofObjectToReturn
- The type of object to return.
A Object containing the resource.
Exception Type Condition ArgumentNullException absoluteUri is null
.XmlException ofObjectToReturn is not a supported type.
[Behaviors: As described above. ]
[Overrides: At a minimum, supporting the return of a Stream object is required. ]
System.Xml.XmlResolver Class, System.Xml Namespace
public abstract Uri ResolveUri(Uri baseUri, string relativeUri);
Resolves the absolute URI from the base and relative URIs.
- baseUri
- The Uri specifying the base URI used to resolve relativeURI.
- relativeUri
- A String specifying the URI to resolve. The URI can be absolute or relative.
A Uri containing the absolute URI, ornull
if relativeUri can not be resolved.
Exception Type Condition XmlException baseUri and relativeUri are null
.
[Behaviors: As described above. ]
[Overrides: This method must be overridden in order to provide the functionality described above, as there is no default implementation. ]
System.Xml.XmlResolver Class, System.Xml Namespace
public abstract ICredentials Credentials { set; }
Sets the credentials used to authenticate Web requests.
A ICredentials instance containing the credentials.
[Behaviors: This property sets the credentials used to authenticate Web requests. If the virtual directory is configured to allow anonymous access, this property does not need to be set. Otherwise, the credentials of the user must be supplied. If credentials are needed but not supplied, the XmlResolver class uses default credentials (System.Net.CredentialCache.DefaultCredentials).This property is write-only.
]
[Overrides: This property must be overridden in order to provide the functionality described above, as there is no default implementation. ]
See System.Xml.XmlUrlResolver.Credentials for an example using this property.
System.Xml.XmlResolver Class, System.Xml Namespace