This documentation is archived and is not being maintained.

XmlResolver.ResolveUri Method

When overridden in a derived class, resolves the absolute URI from the base and relative URIs.

[Visual Basic]
Public Overridable Function ResolveUri( _
   ByVal baseUri As Uri, _
   ByVal relativeUri As String _
) As Uri
[C#]
public virtual Uri ResolveUri(
 Uri baseUri,
 string relativeUri
);
[C++]
public: virtual Uri* ResolveUri(
 Uri* baseUri,
 String* relativeUri
);
[JScript]
public function ResolveUri(
   baseUri : Uri,
 relativeUri : String
) : Uri;

Parameters

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 baseUri value. If relative, it combines with the baseUri to make an absolute URI.

Return Value

A Uri representing the absolute URI or a null reference (Nothing in Visual Basic) if the relative URI can not be resolved.

Exceptions

Exception Type Condition
ArgumentException baseUri and relativeUri are a null reference (Nothing in Visual Basic)

Remarks

The absolute URI may be used as the base URI for any subsequent requests for entities that are relative to this URI.

Notes to Inheritors:  This method has an inheritance demand. Full trust is required to override the ResolveUri method. See Inheritance Demands for more information.

Example

See XmlUrlResolver.GetEntity for an example using this method.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

XmlResolver Class | XmlResolver Members | System.Xml Namespace

Show: