Warning:
This wiki has been archived and is now read-only.

XLIFF 1.2 Mapping

From ITS
Jump to: navigation, search

Introduction

This document provides a recommendation on how the ITS 2.0 data categories are represented in XLIFF 1.2.
For the mapping between ITS 2.0 and XLIFF 2 see the page "XLIFF 2.0 Mapping".

Notes:

  • Please, use the IG mailing list (http://lists.w3.org/Archives/Public/public-i18n-its-ig/) for discussing this topic.
  • The 'structural' entries relate to the cases where the element with the ITS information is a non-inline (structural) element. For example a <p> in HTML.
  • The 'inline' entries relate to the case where the element with the ITS information is an inline element. For example a <span> in HTML.
  • The prefix itsxlf refers to the namespace http://www.w3.org/ns/its-xliff/
  • XLIFF 1.2 does not have a way to represent overlapping <mrk> annotations. So all inline ITS markup that uses <mrk> cannot be represented in an overlapping condition. This is a general 1.2 issue unrelated to ITS.

Data Categories

Translate

Indicates whether a content is translatable or not.
See http://www.w3.org/TR/its20/#trans-datacat for more details.

Structural Elements

Use the translate attribute:

Original:

<p translate='yes|no'>Text</p>

Extraction:

<trans-unit id='1' translate='yes|no'>
 <source>Text</source>
</trans-unit>

If the element is not translatable you can also simply not extract it.

Inline Elements

Extract the non-translatable content as inline code, or use <mrk> with mtype='protected|x-its-translate-yes'>.

Original:

<p>Text <code translate='no'>Code</code></p>

Extraction:

<trans-unit id='1'>
 <source>Text <x id='1'/></source>
</trans-unit>

or

<trans-unit id='1'>
 <source>Text <g id='1'><x id='2'/></g></source>
</trans-unit>

or

<trans-unit id='1'>
 <source>Text <g id='1'><mrk mtype='protected'>Code</mrk></g></source>
</trans-unit>

Localization Note

Provides a way to communicate notes to localizers about a particular item of content.
See http://www.w3.org/TR/its20/#locNote-datacat for more details.

Structural Elements

Use the <note> element in <trans-unit>. Use the priority attribute for the type of note: '1' for 'alert' and '2' or higher for 'description'.

Original:

<p its-loc-note="This is a localization note">Text</p>

Extraction:

<trans-unit id='1'>
 <source>Text</source>
 <note priority='2'>This is a localization note</note>
</trans-unit> 

Inline Elements

Use the comment attribute of the <mrk> element and itsxlf:locNoteType='description|alert' for the type of note. If no itsxlf:locNoteType is specified, the value description is assumed.

Original:

<p><span its-loc-note="This is a localization note">Important</span> text</p>

Extraction:

<trans-unit id='1'>
 <source><mrk mtype='x-its' comment='This is a localization note'>Important</mrk> text</source>
</trans-unit>
  • Unresolved issue: ITS Localization Note created on an XLIFF document may be using locInfoRef with the reference being on a location not accessible once the document is merged back.

Terminology

Marks terms and optionally associates them with information, such as definitions.
See http://www.w3.org/TR/its20/#terminology for more details.

Structural Elements

It is recommended to map terminology information that appears on a structural element in the original document by using an inline <mrk> element.

Original:

<p its-term='yes'>Term</p>

Extracted:

<trans-unit id='1'>
 <source><mrk mtype='term'>Term</mrk></source>
</trans-unit>

Inline Elements

In XLIFF 1.2 terms are denoted using <mrk mtype='term'>:

Original:

<p>Text with a <span its-term='yes'>term</span>.</p>

Extracted:

<trans-unit id='1'>
 <source>Text with a <g id='1'><mrk mtype='term'>term</mrk></g>.</source>
</trans-unit>
  • its:termInfoRef is mapped to itsxlf:termInfoRef (and the value may need to be changed to point to a location accessible from the XLIFF document.)
  • its:termConfidence is mapped to itsxlf:termConfidence
  • When itsxlf:termConfidence is used, the annotated text must be contained within an element with a relevant its:annotatorsRef

Note: If needed, the value of the ITS termInfoRef attribute must be adjusted to point to a resource accessible from the XLIFF document. The location and format of this resource is decided by the tool creating the XLIFF document.

Original:

<p>Text with a <span its-term='yes' its-term-info-ref='http://en.wikipedia.org/wiki/Terminology'
 its-term-confidence='0.9'>term</span>.</p>

Extracted:

<trans-unit id='1' its:annotatorsRef='terminology|http://www.cngl.ie/termchecker'>
 <source>Text with a <g id='1'><mrk mtype='term' itsxlf:termInfoRef='http://en.wikipedia.org/wiki/Terminology'
  itsxlf:termConfidence='0.9'>term</mrk></g>.</source>
</trans-unit>

XLIFF 1.2 has no prescribed way to indicate that a content is not a term (its:term='no'). When this case occurs, it is recommended to use mtype='x-its-term-no'.

<mrk mtype="x-its-term-no" itsxlf:termConfidence="0.5">some text</mrk>

Directionality

Provides information about the text directionality of the content.
See http://www.w3.org/TR/its20/#directionality for more details.

Structural Elements

XLIFF 1.2 has no prescribed way to support directionality. Most XLIFF 1.2 tools supporting directionality use Unicode control characters.

Inline Elements

XLIFF 1.2 has no prescribed way to support directionality. Most XLIFF 1.2 tools supporting directionality use Unicode control characters.

Language Information

Expresses the language for a given content.
See http://www.w3.org/TR/its20/#language-information for more details.

Structural Elements

Because XLIFF document are normally source monlingual, whole paragraphs in the source document that are not in the main source language should generally not be extracted.

If there a need to extract such content, the XLIFF output should use an inline <mrk> element to enclose the content in a different language than the normal source language of the document.

Inline Elements

Use the attribute xml:lang in <mrk>.

Original:

<!doctype html>
<html lang="en">
 <head>
  <meta charset="utf-8">
  <title>My Document</title>
 </head>
 <body>
  <p>Span of text <span lang="fr">en français</span>.</p>
 </body>
</html>

Extraction:

...
<trans-unit id='2'>
 <source>Span of text <g id='1'><mrk xml:lang="fr" mtype='x-its'
  >en français</mrk></g>.</source>
</trans-unit>
...

Element Within Text

Indicates if an element should be treated as part of a text flow, or as a separate "paragraph".
See http://www.w3.org/TR/its20/#elements-within-text for more details.

This data category is not used directly in XLIFF, but it drives what XLIFF element is used to represent the original element in the extracted document:

  • withinText='no': Use <trans-unit>
  • withinText='yes': Use an inline element such as <g>, <bpt>/<ept>, <ph>, etc.
  • withinText='nested': Use either <sub>, or, preferably, extract to a separate <trans-unit>.

Domain

Identifies the topic or subject of a given content.
See http://www.w3.org/TR/its20/#domain for more details.

Structural Elements

Use the attribute itsxlf:domains:

Original:

<!doctype html>
<html lang="en">
 <head>
  <meta charset="utf-8">
  <title>Data Category: Domain</title>
  <script type="application/its+xml">
   <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="2.0"
    xmlns:h="http://www.w3.org/1999/xhtml">
    <its:domainRule selector="//h:*[@class='dom1']" domainPointer="./@class"
     domainMapping="dom1 domain1" />
   </its:rules>
  </script>
 </head>
 <body>
  <p class="dom1">Text in the domain domain1</p>
 </body>
</html>

Extraction:

...
<trans-unit id='2' itsxlf:domains='domain1'>
 <source>Text in the domain domain1</source>
</trans-unit>
...

Inline Elements

Use the attribute itsxlf:domains in <mrk>:

Original:

<!doctype html>
<html lang="en">
 <head>
  <meta charset="utf-8">
  <title>Data Category: Domain</title>
  <script type="application/its+xml">
   <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="2.0"
    xmlns:h="http://www.w3.org/1999/xhtml">
    <its:domainRule selector="//h:*[@class='dom1']" domainPointer="./@class"
     domainMapping="dom1 domain1" />
   </its:rules>
  </script>
 </head>
 <body>
  <p>Span of text <span class="dom1">in the domain domain1</span></p>
 </body>
</html>

Extraction:

...
<trans-unit id='2'>
 <source>Span of text <g id='1'><mrk itsxlf:domains='domain1' mtype='x-its'
  >in the domain domain1</mrk></g></source>
</trans-unit>
...

Text Analysis

Annotates content with lexical or conceptual information for the purpose of contextual disambiguation.
See http://www.w3.org/TR/its20/#textanalysis for more details.

Structural Elements

It is not recommended that Text Analysis be used at a structural level.

If a structural element of the original document has a Text Analysis annotation, it is recommended to represent that annotation using a <mrk> element that encloses the whole content of the <source> element.

Original:

<p its-ta-class-ref="http://nerd.eurecom.fr/ontology#Place"
   its-ta-ident-ref="http://dbpedia.org/resource/Arizona">Arizona</p>

Extraction:

<trans-unit id="1">
 <source><mrk mtype="phrase"
              its:taClassRef="http://nerd.eurecom.fr/ontology#Place"
              its:taIdentRef="http://dbpedia.org/resource/Arizona">Arizona</mrk></source>
</trans-unit>

Inline Elements

Used the ITS attributes in the <mrk> element, with the value of the mtype attribute set to 'phrase'.

If its:taConfidence is used, then the annotated text must be contained within an element with a relevant its:annotatorsRef.

Original:

<div its-annotators-ref="text-analysis|http://enrycher.ijs.si">
...
 <p><span its-ta-class-ref="http://nerd.eurecom.fr/ontology#Place"
         its-ta-ident-ref="http://dbpedia.org/resource/Arizona">Arizona</span></p>
...
</div>

Extraction:

<trans-unit id="1" its:annotatorsRef="text-analysis|http://enrycher.ijs.si">
 <source><mrk mtype="phrase"
              its:taClassRef="http://nerd.eurecom.fr/ontology#Place"
              its:taIdentRef="http://dbpedia.org/resource/Arizona">Arizona</mrk></source>
</trans-unit>

Locale Filter

Specifies that a content is only applicable to certain locales.
See http://www.w3.org/TR/its20/#LocaleFilter for more details.

Structural Elements

When the Target Locale in XLIFF is Undefined

Use ITS attributes:

Original:

<p its-locale-filter-list='fr'>Text A</p>
<p its-locale-filter-list='ja'>Text B</p>

Extraction:

<file original='file.html' datatype='html' source-language='en'>
... 
<trans-unit id='1' its:localeFilterList='fr'>
 <source>Text A</source>
</trans-unit>
<trans-unit id='2' its:localeFilterList='ja'>
 <source>Text B</source>
</trans-unit>

When the Target Locale in XLIFF is Defined

Use the translate attribute (yes if the target locale applies, no if it does not). It is also recommended to keep the original ITS attributes, so the file could potentially be re-purposed (even if it has a current target):

Original:

<p its-locale-filter-list='fr'>Text A</p>
<p its-locale-filter-list='ja'>Text B</p>

Extraction:

<file original='file.html' datatype='html' source-language='en' target-language='fr'>
... 
<trans-unit id='1' translate='yes' its:localeFilterList='fr'>
 <source>Text A</source>
</trans-unit>
<trans-unit id='2' translate='no' its:localeFilterList='ja'>
 <source>Text B</source>
</trans-unit>

If the entry does not apply to the defined target locale you can also simply not extract it.

Inline Elements

When the Target Locale in XLIFF is Undefined

Use the <mrk> element with the original ITS attributes:

Original:

<p>Text <span its-locale-filter-list='fr' its-locale-filter-type='exclude'>text</span></p>

Extraction:

<file original='file.html' datatype='html' source-language='en'>
... 
<trans-unit id='1'>
 <source>Text <g id='1'><mrk its:localeFilterList='fr' its:localeFilterType='exclude'>text</mrk></g></source>
</trans-unit>

When the Target Locale in XLIFF is Defined

Use the <mrk> element with mtype='x-its-translate-yes' if the target does apply or mtype='protected' if it does not. It is also recommended to keep the original ITS attributes, so the file could potentially be re-purposed (even if it has a current target).

Original:

<p>Text <span its-locale-filter-list='fr' its-locale-filter-type='exclude'>text</span></p>

Extraction:

<file original='file.html' datatype='html' source-language='en'>
... 
<trans-unit id='1'>
 <source>Text <g id='1'><mrk mtype='protected' its:localeFilterList='fr' its:localeFilterType='exclude'>text</mrk></g></source>
</trans-unit>

If the content does not apply to the defined target locale you can also simply replace it by an inline code.

Provenance

Communicates the identity of agents that have been involved in the translation of the content or the revision of the translated content.
See http://www.w3.org/TR/its20/#provenance for more details.

Structural Elements

If a standoff <its:provenanceRecords> element is being used (because more than one set of any of the provenance attributes applied to the annotated element):

<target its:provenanceRecordsRef="#ph3">Text</target>
...
<its:provenanceRecords xml:id="ph3">
   <its:provenanceRecord 
     person="John Doe"
     orgRef="http://www.legaltrans-ex.com/"
     revPerson="Tommy Atkins"
     revOrgRef="http://www.vistatec.com/"
     provRef="http://www.examplelsp.com/excontent987/legal/prov/e6354"/>
   <its:provenanceRecord 
     revPerson="John Smith"
     revOrgRef="http://john-smith.qa.example.com"/>
 </its:provenanceRecords>

Important note to the example: The natural carriers of the provenance info on the structural level are <source>, <target>, <trans-unit>, <group>, <file>. However, in case where the <source> and <target> elements are used within an <alt-trans> element (as opposed to <trans-unit>), the parent <alt-trans> element MUST carry all the provenance info relevant for the whole translation candidate.

Alternatively if a <its:provenanceRecords> element is not being used then:

<target its:person="John Doe"
     its:orgRef="http://www.legaltrans-ex.com/"
     its:revPerson="Tommy Atkins"
     its:revOrgRef="http://www.vistatec.com/"
     its:provRef="http://www.examplelsp.com/excontent987/legal/prov/e6354"
>Text</target>

Inline Elements

If a standoff <its:provenanceRecords> element is being used:

inline (when annotating a text fragment that does not correspond to a segment):

 <mrk mtype="x-its" its:provenanceRecordsRef="#ph3">

or otherwise:

 <mrk mtype="seg" its:provenanceRecordsRef="#ph3">

Alternatively if the standoff notation is not being used:

inline (when annotating a text fragment that does not correspond to a segment):

 <mrk mtype="x-its" its:person="John Doe"
     its:orgRef="http://www.legaltrans-ex.com/">

or otherwise:

 <mrk mtype="seg" its:person="John Doe"
     its:orgRef="http://www.legaltrans-ex.com/">

External Resource

Indicates that a node represents or references potentially translatable data in a resource outside the document.
See http://www.w3.org/TR/its20/#externalresource for more details.

Structural Elements

Use the attribute itsxlf:externalResourceRef in <trans-unit>:

Original:

<its:rules version="2.0" xmlns:its="http://www.w3.org/2005/11/its"
 xmlns:html="http://www.w3.org/1999/xhtml">
 <its:externalResourceRefRule selector="//html:video/@src"
  externalResourceRefPointer="."/>
 <its:externalResourceRefRule selector="//html:video/@poster"
  externalResourceRefPointer="."/>
</its:rules> ..
<video
 height=360
 poster=video-image.png
 src=http://www.example.com/video/v2.mp
 width=640>

Extraction:

...
<trans-unit id='2' itsxlf:externalResourceRef="http://www.example.com/video/v2.mp">
...

Inline Elements

Use the attribute itsxlf:externalResourceRef in the inline element that holds the reference (e.g. <x/> or <ph>):

Original:

<!doctype html>
<html lang="en">
 <head>
  <meta charset="utf-8">
  <title>Data Category: External Resource</title>
  <script type="application/its+xml">
   <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="2.0" xmlns:h="http://www.w3.org/1999/xhtml">
    <its:externalResourceRefRule selector="//h:img" externalResourceRefPointer="@src"/>
   </its:rules>
  </script>
 </head>
 <body>
  <p>Image: <img src="example.png" alt="Text for the image"></p>
 </body>
</html>

Extraction:

...
<trans-unit id='3'>
 <source>Image: <x id='1' itsxlf:externalResourceRef="example.png"/></source>
</trans-unit>
...

Target Pointer

Provides a way to associate the node of a given source content (i.e. the content to be translated) and the node of its corresponding target content.
See http://www.w3.org/TR/its20/#target-pointer for more details.

This data category is not mapped to XLIFF but used by extracting and merging tools to get the source content from the original document and put back the translated content at its proper location.

Note that ITS processors working on XLIFF documents should use the following rule to locate the source and target content:

<its:targetPointerRule selector="//xlf:source" targetPointer="../xlf:target"/>

Id Value

Indicates a value that can be used as unique identifier for a given part of the content.
See http://www.w3.org/TR/its20/#idvalue for more details.

Structural Elements

Use the resname attribute in <trans-unit>:

Original:

<p id='p1'>Text of the paragraph.</p>

Extraction:

<trans-unit id='1' resname='p1'>
 <source>Text of the paragraph.</source>
</trans-unit>

Inline Elements

The Id Value data category is not mapped to inline codes.

Preserve Space

Indicates how whitespace should be handled in a given content.
See http://www.w3.org/TR/its20/#preservespace for more details.

Structural Elements

Whitespace handling at the structural level is indicated with xml:space in XLIFF 1.2:

Original:

<listing xml:space='preserve'>Line 1
Line 2</listing>

Extraction:

<trans-unit id='1' xml:space='preserve'>
 <source>Line 1
Line 2</source>
</trans-unit>

Inline Elements

Use the attribute xml:space in <mrk>.

Original:

<para>Normal text and
 <span xml:space="preserve">preserved spaces: [   ]</span>.
</para>

Extraction:

<trans-unit id='1'>
 <source>Normal text and <g id='1'><mrk
  xml:space="preserve" mtype='x-its'>preserved spaces: [   ]</mrk></g>.</source>
</trans-unit>

Note that, currently, few localization applications will honor preserving whitespace for only a given span of text.

Localization Quality Issue

Expresses information related to localization quality assessment tasks.
See http://www.w3.org/TR/its20/#lqissue for more details.

Structural Elements

Localization Quality Issue (LQI) annotation may be used to annotate a <source>, <seg-source> or <target> elements when within a <trans-unit> element or a <alt-trans> element.

<trans-unit id="1">
 <source>This is the content</source>
 <target its:locQualityIssueType="misspelling"
         its:locQualityIssueComment="'c'es' is unknown. Could be 'c'est'"
         its:locQualityIssueSeverity="50"
         its:locQualityIssueProfileRef="http://example.org/qa/v1">c'es le contenu</target>
</trans-unit> 

The attribute its:locQualityIssuesRef should be use to reference a <its:locQualityIssues> element when several instances of the Localization Quality Issue data category annotate the same content. For example:

<trans-unit id="1">
 <source>This is the content</source>
 <target its:locQualityIssuesRef="#lqi1">c'es le contenu</target>
</trans-unit> 
...
<its:locQualityIssues xml:id="lqi1">
 <its:locQualityIssue 
         locQualityIssueType="misspelling"
         locQualityIssueComment="'c'es' is unknown. Could be 'c'est'"
         locQualityIssueSeverity="50" />
 <its:locQualityIssue 
         locQualityIssueType="grammar"
         locQualityIssueComment="Sentence is not capitalized"
         locQualityIssueSeverity="20" />
</its:locQualityIssues>

Inline Elements

The ITS attributes for Localization Quality Issue may be used inline with an <mrk> within a <source>, <seg-source> or <target> elements in a <trans-unit> or a <alt-trans> element. For example for a text fragment not within an existing <mrk> element:

<trans-unit id="1">
 <source>This is the content</source>
 <target><mrk its:locQualityIssueType="misspelling"
              its:locQualityIssueComment="'c'es' is unknown. Could be 'c'est'"
              its:locQualityIssueSeverity="50">c'es</mrk> le contenu</target>
</trans-unit> 

Or when annotating text that corresponds to an existing inline <mrk> element, for example:

<trans-unit id="1">
 <source>This is the content</source>
 <target><mrk mtype="seg" mid="1"
              its:locQualityIssuesRef="#lqi1">c'es le contenu</mrk></target>
</trans-unit> 
...
<its:locQualityIssues xml:id="lqi1">
 <its:locQualityIssue 
         locQualityIssueType="misspelling"
         locQualityIssueComment="'c'es' is unknown. Could be 'c'est'"
         locQualityIssueSeverity="50" />
 <its:locQualityIssue 
         locQualityIssueType="grammar"
         locQualityIssueComment="Sentence is not capitalized"
         locQualityIssueSeverity="20" />
</its:locQualityIssues>

In both cases, as for the structural annotation, the standoff notation is used when several instances of the Localization Quality Issue data category are applied to the same content.

Localization Quality Rating

Expresses an overall measurement of the localization quality of a document or an item in a document.
See http://www.w3.org/TR/its20/#lqrating for more details.

Structural Elements

Use the ITS attributes to annotate a <file>, <group>, <trans-unit> or <alt-trans> elements.

<trans-unit id="1" its:locQualityRatingScore="100"
 its:locQualityRatingScoreThreshold="95"
 its:locQualityRatingProfileRef="http://example.org/qaModel/v13">
 <source>text</source>
 <target>texte</target>
<trans-unit>

Inline Elements

Use the ITS attributes of Localization Quality Rating to annotate a segment (<mrk mtype="seg">) or a given span of the content (<mrk mtype="x-its">).

<trans-unit id="1">
 <source>Some text</source>
 <seg-source><mrk mtype="seg" mid="1">Some text</mrk></seg-source>
 <target><mrk mtype="seg" mid="1"
              its:locQualityRatingScore="0.56"
              its:locQualityRatingScoreThreshold="95"
 >Du texte</mrk></target>
</trans-unit>
<trans-unit id="1">
 <source>Some text and a term</source>
 <target>Du texte et un <mrk mtype="x-its" its:locQualityRatingVote="100"
 its:locQualityRatingVoteThreshold="95"
 its:locQualityRatingProfileRef="http://example.org/qaModel/v13">terme</mrk></source>
</trans-unit>

MT Confidence

Communicates the self-reported confidence score from a machine translation engine of the accuracy of a translation it has provided.
See http://www.w3.org/TR/its20/#mtconfidence for more details.

Structural Elements

Use the ITS attribute its:mtConfidence to annotate the <target> and <bin-target> elements.

The MT Confidence score must be within the scope of a corresponding its:annotatorsRef attribute.

Note: If several MT engines are used to provide different <alt-trans> <target> elements, then the its:annotatorsRef attribute must be used to differentiate the different MT engines. This can be done by annotating each candidate target element with a separate its:annotatorsRef attribute. Alternatively, one its:annotatorsRef attribute can be added at the <file>, <group>, or <trans-unit> level, with the values for the second and subsequent candidate translations set on their respective <target> elements.

<file original="file.html" datatype="html" source-language='en' target-language="fr"
 its:annotatorsRef="mt-confidence|MTServices-XYZ">
 <trans-unit id="1">
  <source>Text</source>
  <alt-trans>
   <target its:mtConfidence="0.8982">Texte</target> <!-- Score provided by MTServices-XYZ -->
  </alt-trans>
  <alt-trans>
   <target its:mtConfidence="0.678" <!-- Score provided by MTProvider-ABC -->
           its:annotatorsRef="mt-confidence|MTProvider-ABC"
   >texte</target>
  </alt-trans>
  <alt-trans>
   <target its:mtConfidence="0.65" <!-- Score provided by MTProvider-JKL -->
           its:annotatorsRef="mt-confidence|MTProvider-JKL"
   >textes</target>
  </alt-trans>
 </trans-unit>
 <trans-unit>
  <source>Some text</source>
  <target its:mtConfidence="0.8982" <!-- Score provided by MTServices-XYZ -->
  >Du texte</target>
 </trans-unit>
</file>

Inline Elements

This data category is not mapped for inline content. However, because the segments are represented by inline markers in XLIFF, when you are annotating a segment, the mapping to XLIFF should use the ITS attributes on the <mrk mtype='seg'> element.

<target>
 <mrk mtype="seg"
    its:mtConfidence="0.8982"
    its:annotatorsRef="mt-confidence|MTServices-XYZ"
 >Some translated text</mrk>
</target>

Allowed Characters

Specifies the characters that are permitted in a given piece of content.
See http://www.w3.org/TR/its20/#allowedchars for more details.

Note: This data category is not mapped to the charclass attribute of XLIFF 1.2 because the placement and semantics of that attribute do not match exactly the ones of its:allowedCharacters.

Structural Elements

Use the ITS attribute on the <source> and <target> elements:

<trans-unit id="1">
 <source its:allowedCharacters="[a-ZA-Z]">Text</source>
</trans-unit>

Inline Elements

Use the ITS attribute on the <mrk> element:

<trans-unit id="1">
 <source>user name: 
  <g id="1"><mrk mtype="x-its" its:allowedCharacters="[a-ZA-Z]">johnDoe</mrk></g>.</source>
</trans-unit>

Storage Size

Specifies the maximum storage size of a given content.
See http://www.w3.org/TR/its20/#storagesize for more details.

Structural Elements

Use the ITS attributes for Storage Size on the <source> and <target> elements:

<trans-unit id="1">
 <source its:storageSize="12"
         its:storageEncoding="UTF-16"
         its:lineBreakType="crlf">Text</source>
</trans-unit>

Inline Elements

Use the ITS attributes for Storage Size on the <mrk> element:

<trans-unit id="1">
 <source><mrk its:storageSize="8"
              its:storageEncoding="UTF-16" mtype="x-its">CONTINUE</mrk></source>
</trans-unit>

References