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
providerPortrayalCatalogueProviderregisteredBytesIReadOnlyDictionary<string, byte[]>
Properties
Provider
Gets the underlying provider (for subclass use).
protected PortrayalCatalogueProvider Provider { get; }
Property Value
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
absoluteUriUriThe URI returned from ResolveUri(Uri, string).
rolestringCurrently not used.
ofObjectToReturnTypeThe type of object to return. The current version only returns System.IO.Stream objects.
Returns
Exceptions
- XmlException
ofObjectToReturnis not aStreamtype.- UriFormatException
The specified URI is not an absolute URI.
- ArgumentNullException
absoluteUriis 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)