Class XslCompiledTransformEngine

Namespace: redb.Route.Xslt
Assembly: redb.Route.dll

Built-in backed by the BCL
(System.Xml.Xsl) — zero external dependencies, XSLT 1.0 (like Apache Camel's default
JAXP engine; use a Saxon-backed engine for 2.0/3.0). The stylesheet is compiled once at construction
and the compiled template is reused for every transform (the compilation is the expensive part).

The compiled transform is loaded with — inline script and
the document() function are disabled, which is the safe default for stylesheets coming from
outside the application.

public sealed class XslCompiledTransformEngine : IXsltEngine

Inheritance

Object→XslCompiledTransformEngine

Implements

Methods

FromContent(string)

Compiles the engine from an inline stylesheet document. Self-contained stylesheets only —

public static XslCompiledTransformEngine FromContent(string stylesheetXml)

FromFile(string)

Compiles the engine from a stylesheet file (or URL). The path is used as the base URI, so

public static XslCompiledTransformEngine FromFile(string stylesheetPath)

Transform(object?, XsltOutput, IReadOnlyDictionary<string, object?>?)

Transforms body through the compiled stylesheet and materialises the result

public object Transform(object? body, XsltOutput output, IReadOnlyDictionary<string, object?>? parameters)