Export (0) Print
Expand All

XmlResolver.GetEntity Method

When overridden in a derived class, maps a URI to an object containing the actual resource.

[Visual Basic]
Public MustOverride Function GetEntity( _
   ByVal absoluteUri As Uri, _
   ByVal role As String, _
   ByVal ofObjectToReturn As Type _
) As Object
[C#]
public abstract object GetEntity(
 Uri absoluteUri,
 string role,
 Type ofObjectToReturn
);
[C++]
public: virtual Object* GetEntity(
 Uri* absoluteUri,
 String* role,
 Type* ofObjectToReturn
) = 0;
[JScript]
public abstract function GetEntity(
   absoluteUri : Uri,
 role : String,
 ofObjectToReturn : Type
) : Object;

Parameters

absoluteUri
The URI returned from ResolveUri
role
The current version does not use this parameter when resolving URIs. This is provided for future extensibility purposes. For example, this can be mapped to the xlink:role and used as an implementation specific argument in other scenarios.
ofObjectToReturn
The type of object to return. The current version only returns System.IO.Stream objects.

Return Value

A System.IO.Stream object or a null reference (Nothing in Visual Basic) if a type other than stream is specified.

Exceptions

Exception Type Condition
XmlException ofObjectToReturn is neither a null reference (Nothing in Visual Basic) nor a Stream type.
UriFormatException The specified URI is not an absolute URI.
NullReferenceException absoluteUri is a null reference (Nothing in Visual Basic).
Exception There is a runtime error (for example, an interrupted server connection).

Remarks

This method is used when the caller wants to map a given URI into the object containing the actual resource that the URI represents. The type of object returned is negotiable however the implementation must always support System.IO.Stream.

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:
© 2014 Microsoft