---
title: "<roles>"
source: https://dev.pageseeder.com/guide/configuration/psml/psml_document_config/document_roles.html
description: "How to use the <roles> element in the PSML document-config.xml file to control what roles are available for specific content in PSML documents"
last_updated: 2026-08-11T16:33:44+10:00
tokens: ~437
---

# PSML content roles

This article describes how to use the `<roles>` element in the PSML `document-config.xml` file to control what roles are available for specific content in PSML documents. The roles are used to control the formatting of certain elements and are different to [user roles](/reference/glossary/role.md).

*This element can only be used from the version 6 user interface in PageSeeder v5.99 or higher.*

It has the following structure:

```xml
<roles>
  <role type="..." ... />*
</roles>
```

## Behavior

Roles can only be configured for a specific document type and there are no default roles, therefore there is no `@override` boolean attribute on the `<roles>` attribute.

There can be multiple `<role>` elements with the same `@type` value. If there are no `<role>` elements for a particular `@type`, then the editor allows any role for that type, otherwise, only the roles defined for that type are allowed.

## Details

Each `<role>` element defines the following:

| Attribute | Description |
| --- | --- |
| `type` | The PSML element the role applies to (`preformat`, `table`, `col`, `row`, `cell`, `hcell`, `list`, `nlist`) |
| `name` | The name of the role |
| `description` | A description for this role (optional) |

### Example

```xml
<roles>
  <role type="cell"
        name="indent-1"
        description="Indentation level 1" />
  <role type="cell"
        name="indent-2"
        description="Indentation level 2" />
  <role type="cell"
        name="indent-3"
        description="Indentation level 3" />
  <role type="table"
        name="presentation"
        description="Table used for presentation" />
  <role type="table"
        name="data"
        description="Table containing data" />
</roles>
```

