A complete reference of PageSeeder's markup language PSML



The <fragment> element is a simple container for PSML content.

It has a unique identifier within the document so that it can be referenced externally. It may also have a type.

The <fragment> element is used for unspecialized fragments. Other kind of fragments are represented using different elements as their content and internal structure is different:

Usage context

Element categorystructure
PSML levelportable
Permitted content<block> <blockxref> <heading> <para> <preformat> <table>
Permitted parent<section>
HTML equivalentno equivalent
OpenXML equivalentno equivalent
PSStandard equivalent<body>


This element includes the following attributes:

deletedbooleannoIf "true" this is fragment will be ignored by upload.
idfragment-idyesThe Fragment ID.
typefragment-typenoThe template type.
labelslabel-listnoA list of fragment labels


If "true" this is fragment will be ignored by upload. It is added when comparing document versions to show the location of a deleted fragment.

This attribute was introduced in PSML beta 12 in PageSeeder 5.9605.


The fragment ID must be unique within the document.

Fragment IDs are generally natural integers automatically incremented when new fragments are created in PageSeeder. Other identifiers can used provided that they are unique and valid.

Non-integer fragment IDs can be created programmatically, when a new document is created from a template or by upload.


The fragment type is optional.

When a type is not specified, the fragment is untyped. PageSeeder default documents use untyped fragments; and untyped fragments use the default configuration.

The fragment type is used to further qualify a fragment. This can be used to associate a fragment template and therefore a type-specific set of labels or some predefined content. Within PageSeeder, a typed fragment can have a specific style or editor. During the publishing or outside PageSeeder, the type can be used to indicate that the fragment should be processed differently.


A comma-separated list of labels to attach to this fragment. This attribute overrides the <labels> element in <locator>.

This attribute was introduced in PSML beta 10 in PageSeeder 5.90.


A simple untyped title fragment.

<fragment id="1">
  <heading level="1">Alice in Wonderland</heading>

A typed fragment.

<fragment id="1" type="thumbnail">
  <image ... />

A labelled fragment.

<fragment id="1" labels="internal">
  <para>Office use only</para>

Note that a fragment can also be expressed as a template in the document-template

<t:fragment type="parameter" title="Parameter">
   <properties-fragment id="4">
    <property name="field" title="Field" value=""/>
    <property name="type" title="Type" value=""/>
    <property name="mandatory" title="Mandatory" value=""/>
    <property name="desc" title="Description" value=""/>


XML Schema

<xs:element name="fragment">
      <xs:choice minOccurs="1"
           <xs:group ref="block-style-group"
        <xs:attribute name="id"
        <xs:attribute name="type"
        <xs:attribute name="labels"

Relax Schema

element fragment {
   attribute id { fragment-id },
   attribute type { fragment-type }?,
   attribute labels { label-list }?, 
   (block | blockxref | heading |
     list | nlist | para | preformat
          | table)*


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

PS Standard XML

In the Standard Format, fragments are expressed using the <body> element and a different algorithm is used to compute their Fragment identifier. Support for the @pagebreak attribute has been dropped.

Section formats have been deprecated and new specialized fragments have been created. The PSML <fragment> element corresponds to a the Standard Format <body> element when the parent section has no specific format.

See also

Sample PSML code

Created on , last edited on