Content XML 3.4
Note
Applies to Typefi Server and Typefi Designer 8.16 and later.
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 or Typefi Orion, 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 third-party.
Workflow labels
Some CXML elements are specific to a particular Typefi workflow. Where applicable, elements are labelled as follows:
- InDesign — supported in the InDesign workflow only
- DOCX — supported in the DOCX workflow only
Elements with no label are supported in all workflows.
Schema
This guide covers CXML 3.4. The schema is located at:
https://www.typefi.com/TPS/content/3_4/ContentXML.xsd
Hello, World
Here is a simple CXML document that will run through Typefi Server:
<content xmlns="http://www.typefi.com/ContentXML">
<section type="Chapter">
<p>Hello, World.</p>
</section>
</content>Although, in practice, it tends to look more like this:
<?xml version="1.0" encoding="UTF-8"?>
<tps:content xmlns:tps="http://www.typefi.com/ContentXML"
xmlns:xsl="http://www.w3.org/2001/XMLSchema-instance"
schemaVersion="3.4"
xsl:schemaLocation="http://www.typefi.com/ContentXML
http://www.typefi.com/TPS/content/3_4/ContentXML.xsd"
whiteSpaceMode="strict">
<tps:section type="Chapter">
<tps:p type="Body">Hello, World.</tps:p>
</tps:section>
</tps:content>For clarity, our CXML examples below will use the simpler form that omits the tps: namespace prefix.
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.
What's new
Content XML 3.4 is a major release that corresponds with the release of Typefi Orion (v1.0), and Typefi Server v8.19, which added several new features:
Track changes
CXML 3.4 extends all elements that supported @status in CXML 3.3 with two new attributes: @author and @dateTime. In CXML 3.4, these attributes are also applied to additional inline elements. Together, the three tracked change attributes allow CXML to round-trip change tracking information between DOCX and CXML formats.
| Attribute | Value | Description |
|---|---|---|
| status | added changed deleted | Indicates the modification status of the element. |
| author | string | The author of the tracked change. |
| dateTime | ISO 8601 datetime string | The date and time of the tracked change (2024-01-09T14:37:00Z). |
In addition, the <style> element can now apply tracked changes to a group of inline content — wrapping multiple inline elements so that the tracked change attributes apply to all of them collectively. See Soft styles for the updated <style> attribute table and examples.
Comments
DOCXCXML 3.4 introduces the <comment> element, which supports document comments that appear as part of the document in DOCX format. This is necessary for round-tripping comments between DOCX to CXML. See Comments for full details.
Arbitrary namespace extensions
DOCXAdds support for arbitrary elements and attributes assigned to a specified namespace, allowed at both block and inline levels of CXML content. This is used by Orion and DOCX converters to support comments and track changes in CXML. See Namespace extensions.
Highlight colours
The <style> element now supports highlight colour values via @type. See Soft styles for the updated list of supported values.
Validation improvements
The <style> attribute in <link> and <liFormat> in Content XML 3.3, incorrectly reported a validation failure when a <style> element was nested inside a <c> or other <style> elements within <link> or <liFormat>.
Further information
For more information about Content XML or anything in this guide, contact your Typefi Solutions Consultant, or visit the Help Centre.