Skip to main content

 Element reference

Service API elements from <alias> to <workflow>

<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 , then the contents of the element are XML. In all other cases, the content is considered plain text.

PageSeeder doesn't support binary comments.

Usage context

Permitted contenttext or XML
Permitted parent<comment>

Attributes

This element has the following attributes.

NameTypeRequiredDescription
typexs:stringyesThe media type of the content

@type

This attribute provides the media type of the content.

It follows the following syntax:

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

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.

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

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

HTML content

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

XML content

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

Schema

XML Schema

<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

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

Compatibility

No change since initial API release.

Created on , last edited on