richtext

Defines a rich text message to display on the form.

The richtext item can accept arbitrary HTML as its source. It converts that source into a subset of valid XHTML for display. Elements and attributes that are not supported and that cannot be converted into a supported element or attribute are not displayed.

The supported subset of XHTML elements are as follows:
  • Header elements h1, h2, h3, h4, h5, and h6
  • Block elements p, ol, and ul
  • Inline elements a, b, strong, i, em, u, span, br, sub, and sup
The richtext item also allows the use of the following inline style properties:
  • color
  • font-family
  • font-size
  • font-style
  • font-weight
  • text-align
  • text-decoration

Available options

acclabel, active, bgcolor, border, borderinfo, direction, display, focused, fontcolor, fontinfo, help, itemlocation, itemnext, itemprevious, justify, layoutflow, mouseover, next, orientation, previous, size, value, visible, xformsenabled, xformsreadonly, xformsrequired, xformsvalid, xforms:output

Example

...
<xforms:instance id="rt1" xmlns="">
  <content>
    <richtext>&lt;p&gt;This is an &lt;span style="color:red;"&gt;example&lt;/span&gt; of 
rich text formatting, &amp;amp; use of the ampersand&lt;/p&gt;
    </richtext>
  </content>
</xforms:instance>

...

<richtext sid="R1">
  <xforms:output ref="instance('rt1')/richtext" mediatype="text/html"/>
    <border>on</border>
      <fontcolor>blue</fontcolor>
      <size>
        <width>40</width>
      </size>
</richtext>
...

Usage details

  1. XML entities must be used for the < and the > symbols.
  2. Use &amp;amp; to display the ampersand symbol.
  3. The value option reflects the content of the xforms:output option. You cannot set the content of the value option with a compute. The content of the value option is not displayed in the richtext item.
  4. The default for the layoutflow option is inline.
  5. The default size is 30 characters wide and 5 lines high.