<text>

The <text> block form expands into a text string. (Available as of version 11.09)

Description

The <text> form expands its contents under the ordinary block code rules, but with the option of further marking the { and } scalar context delimiters for a scalar expression so that text contents of the form that contain these delimiters as literal text need not be specially marked up.

If any of the contents expands into XML, the XML is converted into text.

Text wrapped in <text> is HTML-escaped before being displayed

Syntax

<text s_="[SHIFT_MARKER]"
      si_="[SHIFT_IN_MARKER]"
      so_="[SHIFT_OUT_MARKER]"
      e_="[PREFIX_STRING]">
  [TEXT_CONTENTS]
</text>

Attributes

s_
Specifies a "shift" marker which must precede { and follow } for those to be considered scalar context delimiters.

For example, s_="~~" would require ~~{ and }~~ as delimiters for a scalar expression.

Separate "shift in" and "shift out" markers may be specified via the si_ and so_ attributes, respectively.

si_
Specifies a "shift in" marker which must precede { for it to be considered a scalar context delimiter.

For example, si_="[[" so_="]]" would require scalar expressions to be delimited with [[{ and }]].

so_
Specifies a "shift out" marker which must follow } for it to be considered a scalar context delimiter.

For example, si_="*" so_="!" would require scalar expressions to be delimited with *{ and }!.

e_
Specifies a string that must precede both { and } for those to be considered scalar context delimiters.

For example, e_="." would require .{ and .} as delimiters for a scalar expression.

Example

The following example demonstrates how the <text> form can be used to display text that contains { and } as well as a scalar expression. Specifying the shift markers by setting s_="~~", only those { characters preceded by ~~ and those } characters followed by ~~ will be considered scalar context delimiters. All other instances of { and } will be rendered as literal text.

<dynamic foo="16">
  <widget class_="text">
    <text s_="~~">}}} This is example #~~{@foo+1}~~ {{{
    </text>
  </widget>
</dynamic>

If the <text> form was not used, the text would display as: }}} This is example {@foo+1} {{{.