Table of Contents

Class GmlPortrayalCatalogueBase.AssetSourceXmlResolver

Namespace
EncDotNet.S100.Portrayals
Assembly
EncDotNet.S100.Portrayals.dll

Default XmlResolver that resolves xsl:include/ xsl:import URIs against the pre-fetched rule-file bytes.

protected class GmlPortrayalCatalogueBase.AssetSourceXmlResolver : XmlResolver
Inheritance
GmlPortrayalCatalogueBase.AssetSourceXmlResolver
Derived
Inherited Members

Remarks

GetEntity(Uri, string, Type) is invoked synchronously by Load(XmlReader, XsltSettings, XmlResolver) — a .NET API contract we don't own. The base resolver therefore reads from a memory dict that LoadXsltRuleAsync(RuleFile, CancellationToken) pre-fetched on the async hot path; no sync I/O happens here.

Constructors

AssetSourceXmlResolver(PortrayalCatalogueProvider, IReadOnlyDictionary<string, byte[]>)

Creates a resolver backed by the given provider and pre-fetched rule bytes.

public AssetSourceXmlResolver(PortrayalCatalogueProvider provider, IReadOnlyDictionary<string, byte[]> registeredBytes)

Parameters

provider PortrayalCatalogueProvider
registeredBytes IReadOnlyDictionary<string, byte[]>

Properties

Provider

Gets the underlying provider (for subclass use).

protected PortrayalCatalogueProvider Provider { get; }

Property Value

PortrayalCatalogueProvider

Methods

GetEntity(Uri, string?, Type?)

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

public override object? GetEntity(Uri absoluteUri, string? role, Type? ofObjectToReturn)

Parameters

absoluteUri Uri

The URI returned from ResolveUri(Uri, string).

role string

Currently not used.

ofObjectToReturn Type

The type of object to return. The current version only returns System.IO.Stream objects.

Returns

object

A stream object or null if a type other than stream is specified.

Exceptions

XmlException

ofObjectToReturn is not a Stream type.

UriFormatException

The specified URI is not an absolute URI.

ArgumentNullException

absoluteUri is null.

Exception

There is a runtime error (for example, an interrupted server connection).

ResolveUnregistered(Uri, string)

Called when the requested file is not a registered rule file. Returns null by default. Override to provide fallback resolution (e.g. via FetchRuleAsync(string, CancellationToken)).

protected virtual object? ResolveUnregistered(Uri absoluteUri, string fileName)

Parameters

absoluteUri Uri
fileName string

Returns

object