Gå til hovedinnhold

XSLT Transform tool

The XSLT Transform tool applies a sequence of regular-expression transformation rules to block text. Each rule has a pattern and a replacement (with $1, $2 backreference support), and the rules are applied in order. Since Go has no built-in XSLT engine, this provides a lightweight, regex-based equivalent for tag and text rewriting. It does not execute XSLT stylesheets; for stylesheet-based transforms use the okapi-bridge transform step.

By default the rules are applied to source text. When the rules list is empty, blocks pass through unchanged.

IDxslt-transform
SourceBuilt-in
Categorytext-processing
Cardinalitymonolingual
Tagsconfigurable

Parameters

ParameterTypeDefaultDescription
applySourcebooleantrueApply transformation to source text
applyTargetbooleanfalseApply transformation to target text
passOnOutputbooleantruePass the transformation output to subsequent pipeline steps
rulesobject[]Regex-based tag and text transformation rules

Configure these parameters interactively and copy the flow-step YAML on the Tool Reference.

Examples

Rewrite a tag in source text

Replace one element name with another using a regex rule.

applySource: true
rules:
  - pattern: "<b>(.*?)</b>"
    replace: "<strong>$1</strong>"

Processing notes

  • Operates on translatable blocks only; non-translatable blocks pass through unchanged.

  • With no rules configured, blocks pass through unchanged.

Limitations

  • Transformation is regex-based; full XSLT stylesheets are not executed.

  • Patterns use Go's RE2 syntax, which does not support backreferences or lookaround within the match.

← Back to the Tool Reference