Configuring item types
The <ItemType> element in the TranslationManager.xml file is an optional configuration element that you can define for each translatable Content Manager item type to customize what data is sent to SDL TMS and how.
About this task
The <ItemType> element allows you to:
- Aggregate data to merge content from several XML files into a single XML document (also known as stitching)
- Evaluate nodes within the TCM namespace of a translatable Content Manager item to prevent empty content from being sent for translation
You can define an <ItemType> element for each translatable Content Manager item. The following example shows an <ItemType> defined for Folders where the Title of all Folders are aggregated into a single XML file (the translator will therefore receive a list of titles to translate):
<ItemTypes xmlns:tcm="http://www.tridion.com/ContentManager/5.0">
<ItemType type="2" fileExtension="FOL">
<Includes>
<Include id="title" aggregate="true">/tcm:Folder/tcm:Data/tcm:Title</Include>
</Includes>
</ItemType>
</ItemTypes>
An <ItemType> element contains one or more <Include> elements that defines an XPath statement targeting a node within the item XML to identify the translatable content. You can target elements in the TCM namespace within the <Tcm:Data> node of a translatable Content Manager item, therefore you need to declare the tcm prefix used in the <Include> elements XPath statements either in the <Include> elements or in a parent element.
If you do not define your own <ItemType> elements, by default the Translation Manager evaluates the nodes within an item's <Tcm:Data> node and sends the nodes containing content for translation and in separate files, although note that the default analysis (ANL) files strip markup elements from the XML not relevant for translation. If you define your own <ItemType> elements, your values override the default settings.
The <ItemType> element has the following mandatory attributes:
| Attribute (ItemType) | Description |
|---|---|
type | The Tridion item type number:
|
fileExtension | The file extension used for the XML files sent to SDL TMS. The file extension must consist of three characters. Note also that stitched files for an item type are sent with an As you can specify the ANL file based on the file extension, you can use different ANL files to filter content for each item type. On SDL TMS, you must define a corresponding Content Type to specify that this the type of content can be passed for translation. |
The <Include> element and has the following mandatory attributes:
| Attribute (Include) | Description |
|---|---|
id | An attribute with a string value uniquely identifying the include within the item type. |
aggregate | If set to If set to |
The <Include> elements in an <ItemType> are processed depending on the value of the aggregate attribute:
- The
<Include>elements withaggregate="false"are evaluated first; if one or more of the element's XPaths evaluates to valid content, a translation file is created for the item and<Include>elements withaggregate="true"are ignored, otherwise they are processed (see step 2). - For each
<Include>element withaggregate="true", the XPath is evaluated and the results inserted into a document shared between the items of the specific item type. - If an
<ItemType>element has no<Include>statements, no items of that type will be translated.
Content is considered valid according to the aggregate attribute when it meets the following criteria:
If
aggregate="false", an XPath statement is considered to evaluate to valid content according if:- The XPath returns a node that is not null and
- The returned node contains at least 1 child element
If
aggregate="true", an XPath statement is considered to evaluate to valid content according if:- The xpath returns a node that is not null and
- The node contains a non empty text string