Saxon.Api
Class SimpleUriResolver
-
public class SimpleUriResolver
- extends XmlResolver
A simple implementation of XmlResolver
that supplies a delegate function accepting
an absolute URI as its argument and returning a Stream.
Although this class implements XmlResolver
, there is nothing specific to XML in its
function; it can equally be used for resolving URIs for other media types.
Example:
XmlResolver resolver = new SimpleUriResolver(uri => new WebClient().OpenRead(uri))
Constructor Summary |
|
---|---|
SimpleUriResolver (Func<Uri, Stream> fetcher)
Create a |
Method Summary |
|
---|---|
object | GetEntity (Uri absoluteUri, string role, Type ofObjectToReturn) Maps a URI to the content of the retrieved resource. |
Maps a URI to the content of the retrieved resource.
Implements the .NET-defined
XmlResolver
interface, with all its quirks. This implementation simply calls the function that was supplied as the argument to the constructor.Parameters:
absoluteUri
- The absolute URI of the resourcerole
- Not usedofObjectToReturn
- Not usedReturns:
Stream
.