Transformations

One of the core features of XSharper is support for text transformations, which are controlled by transform (or, shortened, tr) attribute of almost all actions.

This attribute controls:

  • text whitespace trimming (start, end, internal, every line )
  • replacing (~ may be replaced with spaces, non-printable characters with . dot, curved or square braces with angled, CRLF to LF or vice versa and so on)
  • character escaping (for XML, or C-like, or regular expressions)
  • expression expansions (whether expressions defined as ${var} or ${{var}} or [[var]] are evaluated and result inserted into text)
  • order in which the escaping and trimming is done (after or before variable expansion)

 

Default transformation is Expand, i.e. expand multi-expressions formatted as ${multi}

Another note is that transformation applies to all text attributes of an action, including the value. It's possible to explicitly exclude the value by setting verbatim="true" attribute.

 

Complete list of transformations can be obtained as