PSML

A complete reference of PageSeeder's markup language PSML

<fragment>

Summary

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>

Attributes

This element includes the following attributes:

NameTypeRequiredDescription
idfragment-idyesThe Fragment ID.
typefragment-typenoThe template type.
labelslabel-listnoA list of fragment labels

@id

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.

@type

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.

Examples

A simple untyped title fragment.

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

A typed fragment.

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

Schema

XML Schema

<xs:element name="fragment">
   <xs:complexType>
      <xs:choice minOccurs="1" maxOccurs="unbounded">
        <xs:group ref="block-style-group" minOccurs="0" maxOccurs="unbounded"/>
      </xs:choice>
      <xs:attribute name="id" type="fragment-id" use="required"/>
      <xs:attribute name="type" type="fragment-type"/>
      <xs:attribute name="labels" type="label-list"/>
   </xs:complexType>
</xs:element>

Relax Schema

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

Compatibility

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

Created on , last edited on