---
title: "Element <content>"
source: https://dev.pageseeder.com/api/elements/element_content.html
description: "API Element reference for <content>"
last_updated: 2026-08-07T17:09:54+10:00
tokens: ~699
---

# \<content\>

## Summary

The text content of a comment.

The `<content>` element is used as a container for textual content of a comment. 

If the content is XML, that is, if its media type is an [XML media type](https://tools.ietf.org/html/rfc3023), then the contents of the element are XML. In all other cases, the content is considered plain text.

> **Note:** PageSeeder doesn't support binary comments.

## Usage context

| Permitted content | `text or XML` |
| --- | --- |
| Permitted parent | `<comment>` |

## Attributes

This element has the following attributes.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| type | `xs:string` | yes | The media type of the content |

### `@type`

This attribute provides the media type of the content.

It follows the following syntax:

```lang-ebnf

top-level type name / [ tree. ] subtype name [ +suffix ]
```

The media type must not be a binary media type and is not to use the “charset” media type parameters as the content is generally output in utf-8. Most comments in PageSeeder use the `text/plain` media type. XML comments must use an XML media type in order for the XML content to be returned unescaped.

For example:

- `text/plain`
- `application/html+xml`
- `application/vnd.example.movie+xml`

> **Tip:** When using XML content, it's recommended that apps avoid using the generic `application/xml` media type and use the `+xml` suffix instead.

## Examples

### Plain text content

This is the default on PageSeeder.

```lang-xml

<content type="text/plain">Hello everyone!

Please mind the new lines as they may be important in plain text!
</content>
```

### HTML content

```lang-html

<content type="application/html+xml">
  <div class="help"></div>
</content>
```

### XML content

```lang-xml

<content type="application/vnd.example.helloworld+xml">
  <greeting>Hello World!</greeting>
</content>
```

## Schema

### XML Schema

```lang-xml

<xs:element name="content" type="content"/>

<xs:complexType name="content" mixed="true">
  <xs:sequence>
    <xs:any processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
  </xs:sequence>
  <xs:attribute name="type" type="content-type" use="required"/>
</xs:complexType>

<xs:simpleType name="content-type">
  <xs:restriction base="mediatype">
    <xs:maxLength value="100"/>
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="mediatype">
  <xs:restriction base="xs:string">
    <!-- This is actually more restrictive than the MIME format -->
    <xs:pattern
              value="[a-zA-Z0-9_]+/[-._a-zA-Z0-9]+(\+[-._a-zA-Z0-9]+)?"/>
  </xs:restriction>
</xs:simpleType>
```

### Relax Schema

```lang-relax

element content {
   attribute type { text { maxLength = "100"}},
   any
}
```

## Compatibility

No change since initial API release.

