Text
Text can be styled at three different levels: paragraph styles, character styles, and soft styles
Paragraphs
The <p> element inserts a paragraph into your document. Paragraphs contain almost all elements in CXML. You can style <p> elements with the optional @type attribute.
New in CXML 3.4
<p> now support @author and @dateTime.
<p> has seven attributes:
| Attribute | Value | Description |
|---|---|---|
| type | string | The name of a paragraph style (defined within Adobe InDesign). |
| id | string | The unique ID of the paragraph. |
| xml:lang | string | The language of the text. The string must be an ISO-639 two-letter code with an (optional) ISO-3166 two-letter country code. See ISO language names and codes . |
| style | string | Set a local style override to customise the appearance of the paragraph background, page break, border, font, and indentation. |
| status | added changed deleted | Indicates the modification status of a paragraph. |
| author NEW | string | The author of the tracked change. |
| dateTime NEW | ISO 8601 datetime string | The date and time of the tracked change (2024-01-09T14:37:00Z). |
A simple paragraph:
<p type="Normal">On second thought lets NOT go to Camelot, tis a silly place</p>Character spans
The <c> element inserts a character span into your document. Character spans are useful for applying character formatting attributes to text that may be less than a paragraph. Character spans override formatting settings from the parent paragraph style.
New in CXML 3.4
<c> now support @author and @dateTime.
<c> has six attributes:
| Attribute | Value | Description |
|---|---|---|
| type | string | Required. The name of the character style (defined within Adobe InDesign). |
| id | string | The unique ID of the character style. |
| xml:lang | string | The language of the text. The string must be an ISO-639 two-letter code with an (optional) ISO-3166 two-letter country code. See ISO language names and codes . |
| status | added changed deleted | Indicates the modification status of a paragraph. |
| author NEW | string | The author of the tracked change. |
| dateTime NEW | ISO 8601 datetime string | The date and time of the tracked change (2024-01-09T14:37:00Z). |
A character span within a paragraph with a character style of "Code" (defined within Adobe InDesign):
<p type="Normal">
Use the function
<c type="Code">getAirspeedVelocity(unladen_swallow)</c>
to calculate the airspeed velocity of an unladen swallow.
</p>Soft styles
The <style> element is used to apply soft styles. Soft styles override specific text character formatting attributes of both paragraph and character styles. Soft styles are introduced via the @type attribute.
New in CXML 3.4
<style> now support @author and @dateTime.
<style> has six attributes:
| Attribute | Value | Description |
|---|---|---|
| type | bold italic underline strikethrough superscript subscript allCaps smallCaps nobreak highlight | Required. The soft style to apply. TIP To apply multiple values simultaneously, use (|) as delimiter. Highlight values: highlightBlack, highlightBlue, highlightCyan, highlightGreen, highlightMagenta,highlightRed, highlightYellow, highlightWhite, highlightDarkBlue, highlightDarkCyan, highlightDarkGreen, highlightDarkMagenta, highlightDarkRed,highlightDarkYellow, highlightDarkGray, highlightLightGray |
| id | string | The unique ID of the soft style. |
| xml:lang | string | The language of the text. The string must be an ISO-639 two-letter code with an (optional) ISO-3166 two-letter country code. See ISO language names and codes . |
| status | added changed deleted | Indicates the modification status of the styled content. |
| author NEW | string | The author of the tracked change. |
| dateTime NEW | ISO 8601 datetime string | The date and time of the tracked change (2024-01-09T14:37:00Z). |
Note
Some @type values are mutually exclusive. Combining superscript with subscript, or allCaps with smallCaps, is invalid and will fail schema validation.
Using soft styles:
<section type="Chapter">
<p type="First">
Some
<c type="Emphasis">character styled</c>
text.
</p>
<p type="Body">
Some
<style type="bold">bold</style>
text.
</p>
<p type="Body">
Some
<style type="italic">italic</style>
text.
</p>
<p type="Body">
Some
<style type="bold|italic">bold italic</style>
text.
</p>
<p type="Body">
Some
<c type="Emphasis">
character styled and
<style type="bold|italic">bold italic</style>
</c>
text.
</p>
</section>Using multiple soft styles simultaneously:
<section>
<p type="Body">
Some
<style type="bold|italic|allCaps">bold, italic, and all caps</style>
text.
</p>
</section>The <style> element can also be used to apply tracked changes to a group of inline content — wrapping multiple inline elements so that author, dateTime, and status apply to all of them collectively.
<p type="Body">
To defeat the rabbit,
<style status="added" author="Arthur" dateTime="2026-01-09T14:37:00Z">
use the
<c type="Emphasis">Holy Hand Grenade</c>
of Antioch.
<footnote>
<p type="Footnote">First shalt thou take out the Holy Pin, then shalt thou count to three.</p>
</footnote>
</style>
</p>Headings
CXML 3.3 and later provides six headings elements:<h1>, <h2>, <h3>, <h4>, <h5>, and <h6>. Each heading element has one attribute:
| Attribute | Value | Description |
|---|---|---|
| type | string | The name of a paragraph style, for example <#type="nameofstyle">Content.</h#>. If omitted, Basic Paragraph is used. |
Heading levels:
<h1 type="Heading-1">The Entire Movie</h1>
<p> It's all here, briefly. </p>
<h2 type="Heading-2">The Knights of the Round Table</h2>
<h3 type="Subhead-1"> Sir Gawain</h3>
<p>Quite brave, mostly.</p>Special characters
InDesign The<char> element enables the insertion of some special characters in your document. It was introduced in CXML 2.0.New in CXML 3.4
<char> now supports @status, @author, and @dateTime.
<char> has four attributes:
| Attribute | Value | Description |
|---|---|---|
| type | currentPageNumber nextPageNumber previousPageNumber sectionMarker rightIndentTab indentToHere endNestedStyleHere | Required. The special character to insert:
|
| status NEW | added changed deleted | Indicates the modification status of the special character. |
| author NEW | string | The author of the tracked change. |
| dateTime NEW | ISO 8601 datetime string | The date and time of the tracked change (2024-01-09T14:37:00Z). |
To insert the Current Page Number in Adobe InDesign:
<char type="currentPageNumber" />A special character with tracked changes:
<char type="currentPageNumber" status="added" author="John Cleese" dateTime="1975-04-05T09:00:00Z" />White space
The @whiteSpaceMode attribute for content (<content>) and Typefi Section (<section>) elements specifies how white space characters—the carriage return (\r or #xD), the linefeed (\n or #xA), the tab (\t or #x9), and the space (' ' or #x20)—should be handled. @whiteSpaceMode supersedes the deprecated @strictSpace attribute. If both are present,@whiteSpaceMode overrides @strictSpace.
@whiteSpaceMode applies to all white space characters within the <content> or a <section> element, and a single document could have varied @whiteSpaceMode attributes on a section by section basis.
The three valid values for @whiteSpaceMode are strict, preserve, and classic.
Strict white space
Strict @whiteSpaceMode was added to make CXML immune to pretty-printing. In strict mode, only the white spaces in the content are considered significant and preserved. Strict@whiteSpaceMode is the default mode when importing Microsoft Word (DOCX) documents or exporting CXML from Adobe InDesign (INDD) documents.
In strict@whiteSpaceMode:
- Carriage returns (
#xD), line feeds (#xA), and tabs (#x9) are treated as insignificant white space and replaced with a single space (#x20). - Adjacent sequences of spaces are treated as insignificant white space and collapsed to a single space (
#x20). - Leading and trailing spaces are removed from all text nodes.
Strict @whiteSpaceMode can be activated in two ways:
- Add
@whiteSpaceMode="strict"on the<content>or<section>element, or - Add
@strictSpace="true"on the<content>or<section>element (deprecated).
Using strict @whiteSpaceMode:
<section whiteSpaceMode="strict">
<p>
And now for something
<s />
<style type="italic">completely</style>
<s />
different.
</p>
</section>Note
The two space <s/> self-closing tags are required for spaces to appear in the final document.
To insert significant white space when using strict whiteSpaceMode, see Explicit white space elements below.
Preserve white space
Preserve @whiteSpaceMode was added to give CXML absolute, literal control of white space.
In this mode, all white space is considered significant and is passed through to the final document.
Note
Do not use this mode if your CXML could be pretty-printed somewhere along the line.
Preserve @whiteSpaceMode can be activated in only one way:
- Add
@whiteSpaceMode="preserve"on the content (<content>) or Typefi Section (<section>) element.
Using preserve@whiteSpaceMode:
<section whiteSpaceMode="preserve">
<p>
It's
<style type="italic">just</style>
a
</p>
<p>
______ _ _ _
| ____| | | | | |
| |__ | | ___ ___| |__ __ _____ _ _ _ __ __| |
| __| | |/ _ \/ __| '_ \ \ \ /\ / / _ \| | | | '_ \ / _` |
| | | | __/\__ \ | | | \ V V / (_) | |_| | | | | (_| |
|_| |_|\___||___/_| |_| \_/\_/ \___/ \__,_|_| |_|\__,_|
</p>
</section>Classic white space
Classic @whiteSpaceMode is a deprecated setting that emulates the behaviour Typefi 2.5 and earlier. Classic @whiteSpaceMode is available for backward compatibility only; it is not recommended for use.
In classic @whiteSpaceMode:
- Carriage returns (
#xD), line feeds (#xA), and tabs (#x9) are treated as insignificant white space and replaced with a single space (#x20). - Adjacent sequences of spaces are treated as insignificant white space and collapsed to a single space (
#x20). - Leading spaces are trimmed from the beginning of paragraph (
<p>) elements.
Classic @whiteSpaceMode can be activated in three ways:
- It is the default setting when no
@strictSpaceor@whiteSpaceModeattribute exists on the content (<content>) or Typefi Section (<section>) element (for backward compatibility). - Add
@whiteSpaceMode="classic"on the<content>or<section>element, or - Add
@strictSpace="false"on the<content>or<section>element (deprecated).
Note
If you pretty-print your CXML in the classic @whiteSpaceMode, it may alter the white space in the final document.
To insert significant white space when using classic @whiteSpaceMode, see Explicit white space elements below.
Explicit white space elements (space, tab, newline/soft return)
Explicit white space elements refer to spaces, tabs, and newline/soft returns. They are generally used to make a document more readable.
If you want to preserve sequences of significant white space (in strict or classic mode) you can do so via explicit white space elements:
- space (
<s>) - tab (
<t>) - newline/soft return (
<l>)
New in CXML 3.4
<s>, <t>, and <l> now support @status, @author, and @dateTime.
<s>, <t>, and <l> elements have four attributes:
| Attribute | Value | Description |
|---|---|---|
| c | integer | The number of times the white space will repeat. |
| status NEW | added changed deleted | Indicates the modification status of the white space element. |
| author NEW | string | The author of the tracked change. |
| dateTime NEW | ISO 8601 datetime string | The date and time of the tracked change (2024-01-09T14:37:00Z). |
Using explicit @whiteSpaceMode:
<section whiteSpaceMode="strict">
<p>
Five spaces:
<s />
<s />
<s />
<s />
<s />
</p>
<p>
Five spaces:
<s c="5" />
</p>
<p>
Five tabs:
<t />
<t />
<t />
<t />
<t />
</p>
<p>
Five tabs:
<t c="5" />
</p>
<p>
Five newlines:
<l />
<l />
<l />
<l />
<l />
</p>
<p>
Five newlines:
<l c="5" />
</p>
</section>A space with tracked changes:
<p type="Body">
And now for something
<s status="added" author="Graham Chapman" dateTime="1975-04-05T09:00:00Z" />
<style type="italic">completely</style>
<s status="added" author="Graham Chapman" dateTime="1975-04-05T09:00:00Z" />
different.
</p>Breaks
The <break> element is used to insert a break between paragraphs (<p>) via the @type attribute. For more information on column, frame, and page breaks, see Break options.
<break> has one attribute:
| Attribute | Value | Description |
|---|---|---|
| type | column frame page oddPage evenPage | Required. Specifies the type of break between paragraphs. |
Note
<break> is only valid between paragraphs and affects the followingparagraph.
Breaks between paragraphs:
<p>Funds earned by Pink Floyd's album "The Dark Side of the Moon"
went towards funding this movie.</p>
<break type="column" />
<p>The band were such fans of the show, they would halt recording
sessions just to watch Monty Python's Flying Circus</p>Note
Adobe InDesign does not support <break> within table cells.