Saxon.Api

 

 

Saxon.Api

Delegate TextResolver


public delegate TextReader TextResolver(Uri uri, Encoding encoding)

Dereferences a URI passed to calls on unparsed-text(), unparsed-text-lines(), unparsed-text-available(), and json-doc().

The XPath specifications imposes rules on how the encoding is inferred if not supplied. For the application to conform with the XPath specification, a user-written TextResolver must implement these rules. Saxon does not enforce this.

Parameters:

uri - The URI of the resource to be retrieved. If a relative URI is supplied in the XPath function call, this will be resolved against the static base URI before calling this resolver.
encoding - The encoding, if known. This will be supplied when an encoding name is given in the XPath function call; in the case of json-doc it defaults to utf-8.

Returns:

A TextReader that delivers the content of the resource. Saxon will consume the content of the TextReader and close it after use.