Applies to Typefi Server and Typefi Designer 8.4.x through 8.6.x, and Typefi Writer 8.7.0 and earlier.
On this page
- Introduction
- Anchors
- Audio
- Breaks
- Conditions ENHANCED
- Content
- Cross-references
- Document links
- Endnotes ENHANCED
- Footnotes
- Hyperlinks
- IDs
- Images
- Indexes
- Lists ENHANCED
- Metadata NEW
- Namespace prefix
- Special characters
- Table of contents NEW
- Tables
- Text
- Typefi Elements
- Typefi Fields
- Typefi Sections
- Video
- White space
- Further information
Introduction ↩
CXML is an abbreviation for Content XML. It is the data format used by Typefi to encode content.
In many Typefi deployments, CXML is completely hidden from users. Content is marked up and styled in Microsoft Word using Typefi Writer and then converted into CXML as an intermediate format before the final Adobe InDesign document, PDF, EPUB, or other output is generated.
But sometimes, a custom conversion to CXML from another format is required. This guide is for developers who are creating these conversions.
TIP When you create a custom conversion, it's a good idea to add a custom namespace prefix. A custom namespace prefix makes it easy to identify a document created by Typefi's native converters vs. a converter written by a 3rd-party.
This guide covers CXML 3.1. The schema is located at:
https://www.typefi.com/TPS/content/3_1/ContentXML.xsd
Hello, World
Here is a simple CXML document that will run through Typefi Server:
Although, in practice, it tends to look more like this:
For clarity, all our examples look like the simpler form above and do not use the tps:
namespace prefix.
Note: While Typefi produces CXML files with the tps:
namespace prefix, it is not required. CXML files are valid with or without the tps:
prefix. However, you can’t use the tps:
prefix on some elements—it has to be all or nothing.
Requirements
- The document encoding (
@encoding
) MUST beUTF-8
. This is the only supported encoding for CXML - The XML namespace (
@xmlns:tps
) MUST behttp://www.typefi.com/ContentXML
- The document MUST have exactly one root content (
<content>
) element - Each Typefi Section (
<section>
) and Typefi Element (<context>
) element MUST have a unique ID (@id
) attribute
Anchors ↩
The <anchor>
element is used in cross-references (<ref>
), document links (<doclink>
), and index entries (<indexterm>
) to specify the destination of a link.
<anchor>
has two attributes:
Attribute | Value | Description |
---|---|---|
id | string | Required. The unique ID of the anchor. |
name | string | The name of the anchor. An anchor with the name attribute also generates a bookmark in Adobe InDesign that appears in the final PDF document. |
An anchor:
Audio ↩
The <audio>
element inserts an audio file into your document.
<audio>
has six attributes:
Attribute | Value | Description |
---|---|---|
ref | string | Required. The file path of the audio file. For example, music/the-meaning-of-life.mp3 |
comment | string | When the @ref attribute is missing, or the audio file cannot be located, the @comment attribute is displayed in its place. |
autoplay | true false |
Determines whether the audio file is automatically played. |
controls | true false |
Determines whether the audio control buttons are displayed. |
loop | true false |
Determines whether to play the audio file in a continuous loop. |
id | string | The unique ID of the audio file. NOTE Excessive use of @id attributes can significantly impact the composition performance of Adobe InDesign; use only when necessary. |
A simple <audio>
element:
Using all the available attributes:
Poster images
The <poster>
element specifies the type of the poster image you want to display in the play area.
<poster>
has two attributes:
Attribute | Value | Description |
---|---|---|
type | none default image |
Required. Specifies the type of image you want to appear in the play area.
|
ref | string | The file path of the image you want to use as the poster. |
With no poster image:
With the default (standard, generic) poster image:
With a custom poster image:
Alternate audio files
The <altRef>
element is used to specify an alternate audio file.
<altRef>
has two attributes:
Attribute | Value | Description |
---|---|---|
ref | string | Required. The file path of the alternate audio file. When the @ref attribute on <audio> is missing, or the audio file cannot be located, <altRef> is used in its place. |
target | string | The target document. |
With alternate audio files:
One possible use of the <altRef>
element with the @target
attribute:
You can use all of the elements and attributes in a single <audio>
element:
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 <break>
affects the preceding paragraph.
NOTE Adobe InDesign does not support <break>
s between paragraphs that are within a table cell.
Breaks between paragraphs:
Conditions ↩
Conditions are used to filter content. Conditions can be applied to content using the <condition>
element, or applied using the @condition
attribute for Typefi Sections (<section>
), tables (<table>
), NEW and Typefi Elements (<context>
) NEW. Conditions can exist both inside and outside paragraphs.
<condition>
has two attributes:
Attribute | Value | Description |
---|---|---|
type | string | Required. The type of condition. |
id | string | The unique ID of the condition. NOTE Excessive use of @id attributes can significantly impact the composition performance of Adobe InDesign; use only when necessary. |
Conditional content using the <condition>
element and using the @condition
attribute:
Content ↩
All CXML documents must have exactly one root element, although it may have sibling comments. For a job to run through Typefi, the root element must be <content>
.
NOTE Although CXML allows for an alternative root element of a Typefi Section (<section>
), this use case was deprecated with the release of Typefi 8.
<content>
has the following attributes:
Attribute | Value | Description |
---|---|---|
xmlns:tps | http://www.typefi.com/ContentXML | Required. Declares the TPS namespace binding. |
xmlns:xsi | http://www.w3.org/2001/XMLSchema-instance | Declares the XML Schema instance namespace binding. |
xsi:schemaLocation |
http://www.typefi.com/ContentXML http://www.typefi.com/TPS/content/3_1/ContentXML.xsd |
Specifies the CXML schema document location for assessment and validation. Requires the @xmlns:xsi namespace binding above. |
schemaVersion | string | Specifies the version of the CXML schema that the document is using. For example, “3.1”. |
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. |
whiteSpaceMode | strict preserve classic |
Specifies how white space characters should be handled. For more information, see White space. |
type | string | Deprecated. The default value is "book". |
strictSpace | true false |
Deprecated. Specifies whether white space characters are considered significant and preserved. |
The root element is <content>
:
Cross-references ↩
The <ref>
element inserts a cross-reference into your document. Cross-references are links to content (internal or external) referenced on a different page other than the current page of your document. With cross-references, you can reference an anchor (<anchor>
) or paragraph (<p>
) (for example, a specific page number, a part of a paragraph, or a full paragraph). If the location of your linked content changes, Adobe InDesign updates the cross-reference.
<ref>
has three attributes:
Attribute | Value | Description |
---|---|---|
refType | anchor paragraph |
Required. Specifies whether the cross-reference destination is an anchor or paragraph. |
refId | string | Required. The unique ID of the anchor or paragraph. |
format | string | Required. The name of the cross-reference format in Adobe InDesign. See also Use cross-reference formats. |
A cross-reference to an anchor:
A cross-reference to a paragraph:
Document links ↩
The <doclink>
element inserts a document link into your document. Document links behave similar to hyperlinks (<link>
), but they link to the ID of an anchor (<anchor>
) or paragraph (<p>
) element in the same document.
<doclink>
has two attributes:
Attribute | Value | Description |
---|---|---|
refType | anchor paragraph |
Required. Specifies whether the document link destination is an anchor or paragraph. |
refId | string | Required. The unique ID of the anchor or paragraph. |
A document link to an anchor:
A document link to a paragraph:
Endnotes ↩
The <endnote>
element inserts an endnote into your document. An endnote is a piece of content at the end of a chunk of text. <endnote>
s behave similarly to footnotes (<footnote>
) and can be embedded anywhere in your document.
NEW <endnote>
s map to actual endnotes in Adobe InDesign CC 2018. For earlier InDesign versions,<endnote>
s map to footnotes.
<endnote>
has two attributes:
Attribute | Value | Description |
---|---|---|
id | string | The unique ID of the endnote. NOTE Excessive use of @id attributes can significantly impact the composition performance of Adobe InDesign; use only when necessary. |
value | string | The value of the endnote. This attribute is not used by Adobe InDesign. |
An endnote:
NOTE You must have a corresponding Endnote Typefi Section in your Adobe InDesign template, as <endnote>
s are placed into Endnote Typefi Sections.
Footnotes ↩
The <footnote>
element inserts a footnote into your document. A footnote is a piece of additional content at the bottom of a page. <footnote>
s can be embedded anywhere in your document. To add a <footnote>
, you must create a new paragraph (<p>
) element inside the <footnote>
element itself.
NOTE Adobe InDesign CC 2018 and earlier does not support footnotes in tables.
<footnote>
has two attributes:
Attribute | Value | Description |
---|---|---|
id | string | The unique ID of the footnote. NOTE Excessive use of @id attributes can significantly impact the composition performance of Adobe InDesign; use only when necessary. |
value | string | The value of the footnote. This attribute is not used by Adobe InDesign. |
A footnote:
NOTE Leading white space in footnote paragraphs (inserted by Microsoft Word) is automatically stripped.
Hyperlinks ↩
The <link>
element inserts a hyperlink into your document. Hyperlinks are links to content not in your document (for example, a file, webpage, or image). The text inside <link>
is the link text.
<link>
has two attributes:
Attribute | Value | Description |
---|---|---|
ref | string | Required. Specifies the hyperlink destination. |
label | string | Specifies a label for the hyperlink. |
A hyperlink:
IDs ↩
The @id
attribute is a unique internal identifier for elements. The @id
attribute allows elements to be cross-referenced.
The @id
attribute is required in these elements:
- Anchors (
<anchor>
) - Typefi Elements (
<context>
) - Typefi Sections (
<section>
)
The @id
attribute is optional in these elements:
- Audio (
<audio>
) - Character spans (
<c>
) - Conditions (
<condition>
) - Endnotes (
<endnote>
) - Footnotes (
<footnote>
) - Index terms (
<indexterm>
) - Ordered lists (
<ol>
) - Paragraphs (
<p>
) - Soft styles (
<style>
) - Unordered lists (
<ul>
) - Video (
<video>
)
TIP Use optional @id
attributes sparingly and just when needed, because they can make your conversion run significantly slower.
Images ↩
The <image>
element inserts an image into your document. Images can exist both inside and outside paragraphs. An image inside a paragraph is placed as an inline image. An image outside a paragraph is placed into an Element Image Frame from your Adobe InDesign template. If there are no (or not enough) Element Image Frames, then the image is not used, and a warning is logged.
<image>
has two attributes:
Attribute | Value | Description |
---|---|---|
ref | string | The file path of the image. |
comment | string | A comment. The comment is also used as the alt text for the image. If the @ref attribute is empty or unresolvable, the @comment attribute is displayed in its place. |
Some images:
Indexes ↩
The <indexterm>
element inserts index terms into your document. Index terms identify text listed in the index. <indexterm>
is loosely based on Docbook's indexterm element.
<indexterm>
has four attributes:
Attribute | Value | Description |
---|---|---|
class | bookmark startofrange endofrange |
Specifies a range of text. |
id | string | The unique ID of the index term.
NOTE Excessive use of |
startref | string | Specifies the start of a chunk of text. |
pageNumberStyle | string | Specifies a character style to apply to the index page number. |
There are four index levels:
<primary>
<secondary>
<tertiary>
<quaternary>
A simple index:
An index with two index levels:
An index with four index levels:
Using the @pageNumberStyle
attribute to specify a character style to apply to the index page number:
You can specify character styles within index levels via the character span (<c>
) element:
You can also apply a sort order to any level via the @sortas
attribute.
Attribute | Value | Description |
---|---|---|
sortas | string | Specifies a sort order for an index. |
Applying alternative sort orders to any level:
See and see also references
The <see>
element inserts a see reference into your document; the <seealso>
element inserts a see also reference into your document. <see>
and <seealso>
references are nested within an <indexterm>
element.
A see reference:
A see also reference:
Creating an index to a range of text
There are two ways to create an index reference to a range of text: the Microsoft Word approach and the DocBook approach.
Microsoft Word approach
The Microsoft Word approach can be used in workflows where the CXML comes from Typefi Writer. An <indexterm>
begins the range; a bookmark (anchor) ends it:
DocBook approach
The DocBook approach can be used in workflows where the CXML is not coming from Typefi Writer:
Lists ↩
Lists are mostly controlled within InDesign using the standard paragraph style properties, but you can optionally override the format using list format (<liFormat>
). You can also add conditions (<condition>
or @condition
) and metadata (<meta>
) to lists.
There are two types of lists: ordered (<ol>
) and unordered (<ul>
).
Ordered lists
The <ol>
element defines an ordered list. An ordered list can be numerical or alphabetical. Use the list item (<li>
) element to define list items.
<ol>
has five attributes:
Attribute | Value | Description |
---|---|---|
type | string | Specifies the type of the ordered list. |
isRoot | true false |
Deprecated. Specifies if the unordered list is the top-level (root) list. The default value is false. |
id | string | The unique ID of the index term. NOTE Excessive use of @id attributes can significantly impact the composition performance of Adobe InDesign; use only when necessary. |
style | none 1 A a I i 01 001 0001 abjad alif ba tah kanji katakana modern katakana traditional hebrew biblical hebrew non‑standard |
Specifies the style of the ordered list.
|
start | integer | Starts number the list at the @start value. Must be a numeric value, even if the list uses letters or Roman numerals for numbering. |
List format
The <liFormat>
element overrides how your list is formatted.
<liFormat>
has one attribute:
Attribute | Value | Description |
---|---|---|
align | left center right justify justifyLeft justifyCenter justifyRight justifyFull |
Specifies the horizontal alignment of items in a list. |
And you can set the list level and style via the List Item Reference (<liRef>
) element, which has two attributes:
Attribute | Value | Description |
---|---|---|
level | integer | Specifies the list level. |
style | string | Specifies the style of the list. NOTE While the CXML schema defines this as a string, the expected values are the same as for ol@style . |
List item
The <li>
element defines a list item. <li>
is used in ordered lists and unordered lists.
An ordered list with style:
An ordered list formatted with <liFormat>
:
Unordered lists
The <ul>
element defines an unordered (bulleted) list. Use <ul>
together with the list item (<li>
) element to create unordered lists.
<ul>
has five attributes:
Attribute | Value | Description |
---|---|---|
type | string | Specifies the type of the unordered list. |
isRoot | true false |
Deprecated. Specifies if the unordered list is the top-level (root) list. The default value is false. |
id | string | The unique ID of the index term. NOTE Excessive use of @id attributes can significantly impact the composition performance of Adobe InDesign; use only when necessary. |
style | string | Specifies the style of the unordered list. This attribute is not used by Adobe InDesign. |
A simple unordered list:
Metadata ↩
NEW in Content XML 3.1.
The <meta>
element inserts metadata into the content. Metadata is "data about data" and can be used to pass information through a workflow that may or may not be included in an output. It tends to be used in complex workflows where Typefi is part of a much larger system.
<meta>
has one attribute:
Attribute | Value | Description |
---|---|---|
type | string | Categorises different types of metadata. You can choose the types of metadata you want to categorise. NOTE Typefi does not use this value. It is provided for users who wish to organise or categorise their metadata. |
Metadata can appear almost anywhere in CXML.
Between Typefi Sections:
Between paragraphs:
Within paragraphs and styles:
Within Typefi Elements:
In table cells:
Namespace prefix ↩
Namespaces in XML are a way to avoid any potential name conflicts by differentiating elements or attributes within an XML document that may have identical names, but different definitions. A namespace is bound to a namespace prefix via the @xlmns
attribute on the root element. As its name suggests, a namespace prefix is used to prefix element names.
CXML uses the tps:
namespace prefix. It is defined via the @xlmns
attribute on the root content (<content>
) element. CXML files are valid, and will run through Typefi, with or without the tps:
prefix. However, you can't use the tps:
prefix on just some elements—it has to be all or nothing.
For clarity, our examples do not use the tps:
namespace prefix.
Special characters ↩
The <char>
element enables the insertion of some special characters in your document. It was introduced in CXML 2.0.
<char>
has one attribute to insert the associated Adobe InDesign special character (Current Page Number, Next Page Number, Previous Page Number, Section Marker, Right Indent Tab, Indent To Here, and End Nested Style Here):
Attribute | Value | Description |
---|---|---|
type | currentPageNumber nextPageNumber previousPageNumber sectionMarker rightIndentTab indentToHere endNestedStyleHere |
Required. Inserts a special character—Current Page Number, Next Page Number, Previous Page Number, Section Marker, Right Indent Tab, Indent To Here, or End Nested Style Here—in Adobe InDesign. |
To insert the Current Page Number in Adobe InDesign:
Table of contents ↩
NEW in Content XML 3.1.
The <toc>
element inserts a table of contents (TOC) into your document.
<toc>
has one attribute:
Attribute | Value | Description |
---|---|---|
type | string | Specifies the Adobe InDesign TOC style used to determine the appearance of the generated table of contents text. NOTE If no TOC style is specified, InDesign's [Default] TOC style is used. If the specified TOC style in InDesign is empty, an empty TOC is generated. |
<toc>
can appear in three positions within CXML.
Directly under a Typefi Section (<section>
):
Inline, as a sibling to paragraph (<p>
) elements in a story:
Directly under a Typefi Element (<context>
):
NOTE The scope of a TOC generated by a <toc>
depends on its parent <section>
. If a <toc>
is within a TOC Typefi Section (as defined in Typefi Designer), then the <toc>
generates a TOC for the entire document. If a <toc>
is within a Main Story Section (as defined in Typefi Designer), then the <toc>
generates a TOC for that specific Typefi Section.
Tables ↩
CXML tables are loosely based on the OASIS Exchange Table Model.
The top-level element is <table>
. <table>
elements can be placed inside paragraphs. A table nested within a paragraph overrides the inherited (external) paragraph style of a master table.
<table>
has three attributes:
Attribute | Value | Description |
---|---|---|
type | string | The name of the Adobe InDesign table style. Tables without a type or with an unknown type will use [Basic Table] as a fallback. |
width | string | The width of the table. Width is either a fixed (absolute) value, percentage, or proportional width. Labels for fixed values are case insensitive. Allowed labels are:
For more information, see note from the Oasis Exchange table specification below. When a percentage or proportional width is specified, the effective table width in Adobe InDesign is reduced by the sum of half the left and right table border stroke, and the text frame insets and paragraph indents. |
condition | string | The name of the condition; for more information, see Conditions. |
NOTE The Oasis Exchange table specification states:
Either proportional measure of the form _number*_, e.g., "5*" for
5 times the proportion, or "*" (which is equivalent to "1*"); fixed
measure, e.g., “2pt” for 2 point, “3pi” for 3 pica. (Mixed measure,
e.g., 2*+3pt, while allowed in the full CALS table model, is not
supported in this Exchange model.) Coefficients are positive integers
or fixed point numbers; for fixed point numbers, a leading (possibly 0)
integer part is required, and implementations should support at least
2 decimal places. A value of "" [the null string] is treated as a
proportional measure of "1*".
Columns
A table (<table>
) contains a table group (<tgroup>
), which contains columns (<colspec>
). <colspec>
elements are specified in a left-to-right column order and define column information for each column in a <tgroup>
.
<tgroup>
has one attribute:
Attribute | Value | Description |
---|---|---|
cols | integer | Required. Specifies the number of columns that apply to the table header (<thead> ), table rows (<tbody> ), and table footer (<tfoot> ).The value of the @cols attribute must match the count of the columns (<colspec> ) and vice versa. |
NOTE While the CXML 3.1 schema supports multiple <tgroup>
s, this use is deprecated as Adobe InDesign does not fully support multiple <tgroup>
s. Support for multiple <tgroup>
s will be removed in a future CXML release.
<colspec>
has four attributes:
Attribute | Value | Description |
---|---|---|
colname | string | Required. A unique name for the column; used when merging cells using entry@namest and entry@nameend . |
align | left center right justify justifyLeft justifyCenter justifyRight justifyFull |
Specifies the horizontal alignment of the column. This value overrides the horizontal alignment of any Adobe InDesign paragraph style within the column. However, this attribute is also overridden by any <entry> within the column that has its own align attribute. |
rotate | 0 90 180 270 |
The rotation of the content. This value overrides the text rotation of the Adobe InDesign cell styles within this column. NOTES
|
colwidth | string | The width of the column.@colwidth is either a fixed (absolute) value and label, proportional width, or percentage measurement. Percentage measurements are included for legacy support.Labels for fixed values are case insensitive. Allowed labels are:
For more information, see note from the Oasis Exchange table specification above. NOTE If the sum of the @colwidth for all columns does not equal table@width , then table@width overrides colspec@colwidth . |
These @colwidth
values are all valid:
Rows
The table header (<thead>
) may contain any number of <row>
elements.
The table body (<tbody>
) must contain at least one <row>
element (or the table won't work in Adobe InDesign).
The table footer (<tfoot>
) may contain any number of <row>
elements.
The <row>
element contains table cell (<entry>
) elements for each table cell.
These rows are all valid:
Cells
The <entry>
element is used to create table cells.
<entry>
has seven attributes:
Attribute | Value | Description |
---|---|---|
type | string | Specifies the name of an Adobe InDesign cell style. Cell styles affect cell border stroke and color, background color, and cell insets. |
namest | string | Specifies the starting colspec@colname when horizontally merging cells. |
nameend | string | Specifies the ending colspec@colname when horizontally merging cells. |
morerows | integer | Specifies the number of additional rows when vertically merging cells. Cannot extend beyond <thead> into <tbody> , or <tbody> into <tfoot> . |
valign | top middle bottom justify |
Specifies the vertical alignment for the cell contents. This value overrides the vertical justification of any Adobe InDesign cell style. |
align | left center right justify justifyLeft justifyCenter justifyRight justifyFull |
Specifies the horizontal alignment for the cell contents. This value overrides the parent colspec@align attribute and the horizontal alignment of any Adobe InDesign paragraph style within the cell. |
rotate | 0 90 180 270 |
Specifies the rotation (clockwise) of the cell contents. This value overrides the text rotation within any Adobe InDesign cell style. NOTES
|
Table cell styles
Cell styles (via entry@type
) alter the border stroke and color, the background fill, and cell insets.
A styled table cell:
Cell merging
Column spans are accomplished using entry@namest
and entry@nameend
. The value of each of these attributes must correspond to a value in colspec@colname
.
Row spans are accomplished via entry@morerows
. The @morerows
attribute is an integer count of the extra rows the cell covers (not the total number of rows).
If you wanted to represent this table in CXML:
Date | Consumer price index | Private consumption chain price index | Other consumer price measures | |||||
---|---|---|---|---|---|---|---|---|
All groups | Excluding volatile items | Market prices excluding volatile items | Based on seasonally adjusted quarterly price changes | |||||
Goods | Services | Total | Weighted median | Trimmed mean | ||||
2003/4 | ||||||||
Dec | 2.4 | 2.4 | 1.6 | 2.2 | 1.8 | 1.0 | 2.8 | 2.5 |
Then, your CXML would look like this:
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.
<p>
has three attributes:
Attribute | Value | Description |
---|---|---|
type | string | The name of a paragraph style (defined within Adobe InDesign). |
id | string | The unique ID of the index term. NOTE Excessive use of @id attributes can significantly impact the composition performance of Adobe InDesign; use only when necessary. |
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. |
A simple paragraph:
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.
<c>
has three attributes:
Attribute | Value | Description |
---|---|---|
type | string | Required. The name of the character style (defined within Adobe InDesign). |
id | string | The unique ID of the index term. NOTE Excessive use of @id attributes can significantly impact the composition performance of Adobe InDesign; use only when necessary. |
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. |
A character span within a paragraph with a character style of "Code" (defined within Adobe InDesign):
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.
<style>
has three attributes:
Attribute | Value | Description |
---|---|---|
type | bold italic underline outline strikethrough superscript subscript allCaps smallCaps nobreak |
Required. The appearance override for the text. NOTE To apply multiple overrides simultaneously, use the vertical pipe ( | ) as a delimiter. |
id | string | The unique ID of the index term. NOTE Excessive use of @id attributes can significantly impact the composition performance of Adobe InDesign; use only when necessary. |
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. |
Using soft styles:
Using multiple soft styles simultaneously:
Typefi Elements ↩
The <context>
element inserts a Typefi Element into your document. Typefi Elements represent a chunk of content that is outside the main story flow in your Adobe InDesign template. Typefi Elements can exist both inside or outside of paragraphs.
Typefi Designer supports three types of Typefi Elements: fixed, inline, and floating. In CXML, <context>
represents all three types.
Fixed and inline Typefi Elements can nest to any number of levels. Floating Typefi Elements cannot be nested, but they can contain nested Typefi Elements (fixed or inline).
<context>
has five attributes:
Attribute | Value | Description |
---|---|---|
type | string | Required. The name of the Typefi Element (defined within Typefi Designer for Adobe InDesign). |
id | string | Required. The unique ID of the Typefi Element. |
variant | string | A floating Typefi Element subtype in Typefi Designer. |
condition | string | The name of the condition; for more information, see Conditions. |
xml:lang | string | The language of 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. |
Some Typefi Elements:
Typefi Fields ↩
Typefi Fields are specialized containers for meta-information about Typefi Projects Fields, Section Fields, and Element Fields. All three types of Typefi Fields are set with the <fieldSet>
element.
Project Fields are set with <fieldSet>
directly under a content (<content>
) element.
Section Fields are set with <fieldSet>
directly under a Typefi Section (<section>
). Section Fields can be either text-based or counters. If the latter, the value attribute for <fieldSet>
is omitted.
Element Fields are text-based and are set with <fieldSet>
directly under a Typefi Element (<context>
).
<fieldSet>
has two attributes:
Attribute | Value | Description |
---|---|---|
name | string | Required. The name of the Typefi Field. |
value | string | The value of the Typefi Field. |
Two Project Fields and a Section Field:
Typefi Sections ↩
The <section>
element inserts a Typefi Section into your document. A Typefi Section is a top-level sectioning element in the root content (<content>
) element. No content can appear outside of a Typefi Section.
<section>
has the following attributes:
Attribute | Value | Description |
---|---|---|
id | string | Required. The unique ID of the Typefi Section. |
type | string | Required. Specifies the type of the Typefi Section. The type must correspond to a Typefi Section created in Typefi Designer. |
condition | string | The name of the condition; for more information, see Conditions. |
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. |
whiteSpaceMode | strict preserve classic |
Specifies how white space characters should be handled. For more information, see White Space. |
strictSpace | true false |
Deprecated. Specifies whether white space characters are considered significant and preserved. |
A Typefi Section containing a Typefi Element (<context>
):
Video ↩
The <video>
element inserts a video file into your document.
<video>
has six attributes:
Attribute | Value | Description |
---|---|---|
ref | string | Required. The file path of the video file. For example, videos/oliver-cromwell.mp4 |
comment | string | When the @ref attribute is missing, or the video file cannot be located, the @comment attribute is displayed in its place. |
autoplay | true false |
Determines whether the video file is automatically played. |
controls | true false |
Determines whether the video control buttons are displayed. |
loop | true false |
Determines whether to play the video file in a continuous loop. |
id | string | The unique ID of the index term. NOTE Excessive use of @id attributes can significantly impact the composition performance of Adobe InDesign; use only when necessary. |
Simple video:
Using all the available attributes:
Poster images
The <poster>
element specifies the type of the poster image you want to display in the play area.
<poster>
has two attributes:
Attribute | Value | Description |
---|---|---|
type | none default image |
Required. Specifies the type of image you want to appear in the play area.
|
ref | string | The file path of the image you want to use as the poster. |
With no poster image:
With the default (standard, generic) poster image:
With a custom poster image:
Alternate video files
The <altRef>
element is used to specify an alternate video file.
<altRef>
has two attributes:
Attribute | Value | Description |
---|---|---|
ref | string | Required. The file path of the alternate video file. When the video@ref attribute is missing, or the video file cannot be located, <altRef> is used in its place. |
target | string | The target document. |
With alternate video files:
One possible use of the (freeform text)altRef@target
attribute:
You can use all of the elements and attributes in a single video element:
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
:
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
:
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
@strictSpace
or@whiteSpaceMode
attribute 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>
)
<s>
, <t>
, and <l>
elements have one attribute:
Attribute | Value | Description |
---|---|---|
c | integer | The number of times the white space will repeat. |
Using explicit @whiteSpaceMode
:
Further information ↩
For more information about CXML or anything in this guide, contact your Typefi Solutions Consultant, or visit the Help Centre.
Comments
0 comments
Please sign in to leave a comment.