Skip to main content

 Element reference

PSML elements from <author> to <xref>



Used for blocks of computer source code typically with a monospaced font.

This element replaces PS Standard’s block level <code> element to avoid confusion with HTML inline <code> elements.

Usage context

Element categoryblock
PSML levelportable
Permitted contenttext only*
Permitted parent<fragment> <item> <block> <cell>
HTML equivalent<pre>
OpenXML equivalent

* This element can also contain character-style elements, however, if the content is edited in CK, extra line-breaks are often inserted before these elements. So it is safer to avoid them.


This element includes the following attributes:

rolerolenoCustom value that can be used for formatting


A role for the preformatted text which can be used for formatting.


 Plain text

Preformatted plain text to preserve whitespace.

<preformat>            Yet do I fear thy nature;
It is too full o' the milk of human kindness
To catch the nearest way.</preformat>

Code sample 

A preformatted code sample.

<preformat role="lang-javascript">function () {
  return "Hello!";

It is good practice to specify the language of code samples. Use the role attribute to specify the language. A common convention adopted by syntax highlighter is to prefix the language name by lang- or language-. In the preceding example, we've used lang-javascript.


XML Schema

<xs:element name="preformat">
  <xs:complexType mixed="true">
    <xs:group ref="character-style-group"
              maxOccurs="unbounded" />
    <xs:attribute name="role" type="role"/>

Relax Schema

element preformat {
  attribute role { role }?,


This element was introduced in the first draft of PSML and is well-supported from PageSeeder 5.1.

Created on , last edited on