Class XsltRuleExecutor
Executes the S-100 Part 9 §9.4 XSLT portrayal engine and returns typed drawing instructions. This is the XSLT-engine sibling of the Lua LuaRuleExecutor under the shared IVectorRuleExecutor contract.
public sealed class XsltRuleExecutor : IVectorRuleExecutor
- Inheritance
-
XsltRuleExecutor
- Implements
- Inherited Members
Remarks
The executor performs four sub-stages, each of which previously lived inline in VectorPipeline:
- Rule selection — match dataset feature types to catalogue rules (uses only the cheap FeatureTypesPresent).
- FeatureXML acquisition from IFeatureXmlSource.
- XSLT transformation — run each applicable XSLT rule against the FeatureXML.
- Drawing-instruction assembly — parse the XSLT output into typed objects via Part9DisplayListReader.
Rule selection deliberately precedes FeatureXML acquisition so the expensive FeatureXML materialisation can be skipped entirely when no applicable XSLT rule exists — the common case for products whose portrayal is entirely Lua-driven (e.g. S-101, S-131). This is behaviour-preserving: an XSLT pass over zero rules always yields an empty display list.
Instances are render-bound: the FeatureXML source, catalogue, and viewport are captured at construction and read at ExecuteAsync(MarinerSettings, CancellationToken) time. Do not cache or reuse an instance across viewport, source, or catalogue changes; construct a fresh executor per render instead (this is cheap — the compiled XSLT transforms are cached in the catalogue, not the executor). The MarinerSettings argument to ExecuteAsync(MarinerSettings, CancellationToken) is ignored because the XSLT engine is driven only by the colour palette and viewport scale, not mariner preferences.
Constructors
XsltRuleExecutor(IFeatureXmlSource, IVectorPortrayalCatalogue, Viewport?)
Initialises a new render-bound XSLT rule executor.
public XsltRuleExecutor(IFeatureXmlSource source, IVectorPortrayalCatalogue catalogue, Viewport? viewport = null)
Parameters
sourceIFeatureXmlSourceSupplies the S-100 Part 9 FeatureXML to transform.
catalogueIVectorPortrayalCatalogueSupplies the portrayal rules, compiled XSLT transforms, and active colour palette.
viewportViewportOptional viewport; when supplied its scale denominator is passed to each rule as the
displayScaleXSLT parameter.
Properties
LastFeatureTypeCount
The number of distinct dataset feature types observed during the most recent ExecuteAsync(MarinerSettings, CancellationToken) call, for process-level telemetry.
public int LastFeatureTypeCount { get; }
Property Value
LastRuleCount
The number of applicable catalogue rules (XSLT and Lua) selected during
the most recent ExecuteAsync(MarinerSettings, CancellationToken) call, for process-level telemetry.
Matches the legacy rules.count dimension: this is the count of
rules whose feature-type predicate matched, not the count of XSLT rules
actually transformed.
public int LastRuleCount { get; }
Property Value
Methods
ExecuteAsync(MarinerSettings, CancellationToken)
Runs the rule stage and returns typed drawing instructions ready for the renderer.
public Task<IReadOnlyList<DrawingInstruction>> ExecuteAsync(MarinerSettings mariner, CancellationToken cancellationToken = default)
Parameters
marinerMarinerSettingsMariner-configurable display preferences (S-100 Part 9 §4.2).
cancellationTokenCancellationTokenSignals that the render has been cancelled. Script interpreters are generally not interruptible mid-evaluation, so implementations honour the token at coarse boundaries; the asynchronous shape exists to allow implementations to await catalogue asset loads (compiled XSLT, Lua source) before driving the synchronous engine.
Returns
Remarks
The mariner argument is ignored; see the type remarks.