Skip to main content

 PSML

A complete reference of PageSeeder's markup language PSML

<fragment>

Summary

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

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

The <fragment> element is used for unspecialized fragments. Other kinds 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

Attributes

This element includes the following attributes:

NameTypeRequiredDescription
deletedbooleannoIf true, this is fragment is ignored by upload
idfragment-idyesThe Fragment ID
typefragment-typenoThe template type
labelslabel-listnoA list of fragment labels

@deleted

If true, this fragment is 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.

@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 be 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 is processed differently.

@labels

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.

Examples

An untyped title fragment.

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

A typed fragment.

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

A labelled fragment.

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

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

<t:fragment type="parameter" title="Parameter">
  <fragment>
    <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=""/>
    </properties>
  </fragment>
</t: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.

See also

Sample PSML code.

Created on , last edited on