Inline code use casesUse CaseExample of RepresentationStandalone code<ph id='1'/>Well-formed spanning code<pc
id='1'>text</pc>Start marker of spanning code<sc id='1'/>End marker of spanning code<ec startRef='1'/>Orphan start marker of spanning code<sc id='1'
isolated='yes'/>Orphan end marker of spanning code<ec id='1'
isolated='yes'/>
Usage of <pc> and <sc>/<ec>A spanning code must be represented using a <sc> element and a <ec> element if the code is
not well-formed or orphan.For example, the following RTF content has two spans of
formatting:Text in \b bold \i and\b0 italics\i0They can only be represented using two pairs of <sc> and <ec> elements:Text in <sc id="1">\b </sc>bold
<sc id="2">\i </sc>and<ec startRef="1">\b0 </ec> italics<ec startRef="2">\i0</ec>If the spanning code is well-formed it may be represented using
either a single <pc> element or using a pair
of <sc> and a <ec> elements.For example, the following RTF content has a single span of
formatting:Text in \b bold\b0 .It can be represented using either notations:Text in <pc id="1" canOverlap="yes" dataRefStart="c1" dataRefEnd="c2">bold</pc>.Text in <sc id="1" dataRef="c1"/>bold<ec startRef="1" dataRef="c2"/>.Processing RequirementsWhen both the <pc> and the <sc>/<ec> representations are
possible, writers may use either one as long as all the information
of the inline code (e.g. original data, sub-flow indicators, etc.)
are preserved.When converting representation between a pair of <sc> and <ec> elements and a <pc> element or
vice-versa, the user agents must map their attributes as shown in
the following table:
Mapping between attributes<pc>
attributes<sc>
attributes<ec>
attributesididstartRef / idtypetypetypedispStartdispdispEnddispequivStartequivequivEndequivsubFlowsStartsubFlowssubFlowsEndsubFlowsdataRefStartdataRefdataRefEnddataRefisolatedisolatedcanCopycanCopycanCopycanDeletecanDeletecanDeletecanReordercanReordercanReordercopyOfcopyOfcopyOfcanOverlapcanOverlapcanOverlapdirdir
Readers must be able to handle any types of inline code
representation.Storage of the original dataMost of the time, inline codes correspond to an original construct
in the format from which the content was extracted. This is the
original data.XLIFF tries to abstract and normalize as much as possible the
extracted content because this allows a better re-use of the material
across projects. Some tools require access to the original data in order
to create the translated document back into its original format. Others
do not.No storage of the original dataIn this option, the original data of the inline code is not
preserved inside the XLIFF document.The tool that created the initial XLIFF document is responsible
for providing a way to re-create the original format properly when
merging back the content.For example, for the following HTML content:This <B>naked mole rat</B> is <B>pretty ugly</B>.one possible XLIFF representation is the following:<unit id="1">
<segment>
<source>This <pc id="1">naked mole rat</pc>
is <pc id="2">pretty ugly</pc>.</source>
<target>Cet <pc id="1">hétérocéphale</pc>
est <pc id="2">plutôt laid</pc>.</target>
</segment>
</unit>Storage of the original dataIn this option, the original data of the inline code is stored
in a structure that resides outside the content (i.e. outside <source> or <target>) but still
inside the <unit> element.The structure is an element <originalData>
that contains a list of <data> entries uniquely
identified within the <unit> by an id attribute. In the content, each
inline code using this mechanism includes a dataRef attribute that points to a
<data> element
where its corresponding original data is stored.For example, for the following HTML content:This <B>naked mole rat</B> is <B>pretty ugly</B>.The following XLIFF representation stores the original
data:<unit id="1">
<segment>
<source>This <pc id="1" dataRefStart="d1" dataRefEnd="d2">naked mole rat</pc>
is <pc id="2" dataRefStart="d1" dataRefEnd="d2">pretty ugly</pc>.</source>
<target>Cet <pc id="1" dataRefStart="d1" dataRefEnd="d2">hétérocéphale</pc>
est <pc id="2" dataRefStart="d1" dataRefEnd="d2">plutôt laid</pc>.</target>
</segment>
<originalData>
<data id="d1"><B></data>
<data id="d2"></B></data>
</originalData>
</unit>This mechanism allows to re-use identical original data by
pointing to the same <data> element.Adding CodesWhen processing a content, there are possible cases when new inline
codes need to be added.For example, in the following HTML help content, the text has the
name of a button in bold:Press the <b>Emergency Stop</b> button
to interrupt the count-down sequence.In the translated version, the original label needs to remain in
English because the user interface, unlike the help, is not translated.
However, for convenience, a translation is also provided and emphasized
using another style. That new formatting needs to be added:Appuyez sur le bouton <b>Emergency Stop</b> (<i>Arrêt d'urgence</i>)
pour interrompre le compte à rebours.Having to split a single formatted span of
text into several separate parts during translation, can serve as another example. For instance, the
following sentence in Swedish uses bold on the names of two
animals:Äter <b>katter möss</b>?But the English translation separates the two names and therefore
needs to duplicate the bold codes.Do <b>cats</b> eat <b>mice</b>?Processing RequirementsUser agents may add inline codes.The id value of the added code must
be different from all id values in both source and
target content of the unit where the new code is added.Merging tools may ignore added inline codes when re-creating
the extracted content in its original format.There are several ways to add codes:Duplicating an existing codeOne way to create a new code is to duplicate an existing one
(called the base code).If the base code is associated with some original data: the new
code simply use these data.For example, the translation in the following unit, the second
inline code is a duplicate of the first one:<unit id="1">
<segment>
<source>Äter <pc id="1" dataRefStart="d1" dataRefEnd="d2">katter
möss</pc>?</source>
<target>Do <pc id="1" dataRefStart="d1" dataRefEnd="d2">cats</pc>
eat <pc id="2" dataRefStart="d1" dataRefEnd="d2">mice</pc>?</target>
</segment>
<originalData>
<data id="d1"><b></data>
<data id="d2"></b></data>
</originalData>
</unit>If the base code has no associated data, the new code must use
the copyOf attribute to indicate
the id of the base code. This allows the merging tool to
know what original data to re-use.For example, the translation in the following unit, the second
inline code is a duplicate of the first one:<unit id="1">
<segment>
<source>Esznek <pc id="1">a magyarok svéd húsgombócot</pc>?</source>
<target>Do <pc id="1">Hungarians</pc> eat
<pc id="2" copyOf="1">Swedish meatballs</pc>?</target>
</segment>
</unit>Processing RequirementsUser agents must not clone a code that has its canCopy attribute is set
to no.The copyOf attribute must be
used when, and only when, the base code has no associated original
data.Creating a brand-new codeAnother way to add a code is to create it from scratch. For
example, this can happen when the translated text requires
additional formating.For example, in the following unit, the UI text needs to stay in
English, and is also translated into French as an hint for the reader.
The French translation for the UI text is formatted in italics:<unit id="1">
<segment>
<source>Press the <pc id="1" dataRefStart="d1" dataRefEnd="d2">Emergency Stop</pc>
button to interrupt the count-down sequence.</source>
<target>Appuyez sur le bouton
<pc id="1" dataRefStart="d1" dataRefEnd="d2">Emergency Stop</pc>
(<pc id="2" dataRefStart="n2" dataRefEnd="n2">Arrêt d'urgence</pc>) pour interrompre
le compte à rebours.</target>
</segment>
<originalData>
<data id="d1"><b></data>
<data id="d2"></b></data>
<data id="n1"><i></data>
<data id="n2"></i></data>
</originalData>
</unit>Converting text into a codeAnother way to add a code is to convert part of the extracted
text into code. In some cases the inline code can be created after
extraction, using part of the text content. This can be done, for
instance, to get better matches from an existing TM, or better
candidates from an MT system.For example, it can happen that a tool extracting a Java properties file to XLIFF
is not sophisticated enough to treat HTML or XML snippets inside
the extracted text as inline code:# text property for the widget 'next'
nextText: Click <ui>Next</ui>Resulting XLIFF content:<unit id="1">
<segment>
<source>Click <ui>Next</ui></source>
</segment>
</unit>But another tool, later in the process, can be used to process
the initial XLIFF document and detect additional inline codes. For
instance here the XML elements such as <ui>.The original data of the new code is the part of the text
content that is converted as inline code.<unit id="1">
<segment>
<source>Click <pc id="1" dataRefStart="d1" dataRefEnd="d2">Next</pc></source>
</segment>
<originalData>
<data id="d1"><ui></data>
<data id="d2"></ui></data>
</originalData>
</unit>Converting XLIFF text content into original data for inline
code might need a tool-specific process as the tool which did the
initial extraction could have applied some conversion to the original
content to create the XLIFF content (e.g. un-escape special
characters).Removing CodesWhen processing a content, there are some possible cases when existing inline
codes need to be removed.For an example the translation of a sentence can result in
grouping of several formatted parts into a single one. For instance, the
following sentence in English uses bold on the names of two
animals:Do <b>cats</b> eat <b>mice</b>?But the Swedish translation group the two names and therefore
needs only a single bolded part.Äter <b>katter möss</b>?Processing RequirementsUser agents may remove a given inline code only if its canDelete attribute is
set to yes.When removing a given inline code, the user agents must remove
its associated original data, except if the original data is shared
with another inline code that remains in the unit. Note that having
to delete the original data is unlikely because such original data
is likely to be associated to an inline code in the source
content.There are several ways to remove codes:Deleting a codeOne way to remove a code is to delete it from the extracted
content. For example, in the following unit, the translated text does
not use the italics formatting. It is removed from the target content,
but the original data are preserved because they are still used in the
source content.<unit id="1">
<segment>
<source>I read <pc id="1" dataRefStart="d1" dataRefEnd="d2">Little
House on the Prairie</pc> to my children.</source>
<target>子供に「大草原の小さな家」を読みました。</target>
</segment>
<originalData>
<data id="d1"><i></data>
<data id="d2"></i></data>
</originalData>
</unit>Converting a code into textAnother way to remove an inline code is to convert it into text
content. This is likely to be a rare use case. It is equivalant to
deleting the code, with the addition to place the original data for
the given code into the content, as text. This can be done, for
example, to get better matches from an existing TM, or better
candidates from an MT system.For instance, the following unit has an inline code
corresponding to a variable place-holder. A tool can
temporarily treat this variable as text to get better matches from an
existing TM.<unit id="1">
<segment>
<source>Cannot find '<ph id="1" dataRef="d1"/>'.</source>
</segment>
<originalData>
<data id="d1">%s</data>
</originalData>
</unit>The modified unit would end up like as shown below. Note that
because the original data was not associated with other inline code it
has been removed from the unit:<unit id="1">
<segment>
<source>Cannot find '%s'.</source>
</segment>
</unit>Converting the original data of an inline code into text
content might need a tool-specific process as the tool which did the
initial extraction could have applied some conversion to the original
content.Editing HintsXLIFF provides some information about what editing operations are
applicable to inline codes:A code can be deleted: That is, the code element as well as
its original data (if any are attached) are removed from the
document. This hint is represented with the canDelete attribute. The
default value is yes: deletion is allowed.For example, the following extracted C string has the code
<ph id='1'/> set to be not
deletable because removing the original data (the variable
placeholder %s) from the string would result in an
error when running the application:A code can be copied: That is, the code is used as a
base code for adding another inline code. See
for more details. This
hint is represented with the canCopy attribute. The
default value is yes: copy is allowed.A code can be re-ordered: That is, a given code can be moved
before or after another inline code. This hint is represented with
the canReorder attribute.
The default value is yes: re-ordering is
allowed.Note that often those properties are related and appear together.
For example, the code in the firt unit shown below is a variable
placeholder that has to be preserved and cannot be duplicated, and when
several of such variables are present, as in the second unit, they
cannot be re-ordered:<unit id="1">
<segment>
<source>Can't open '<ph id="1" dataRef="d1" canCopy="no" canDelete="no"/>'.</source>
</segment>
<originalData>
<data id="d1">%s</data>
</originalData>
</unit>
<unit id="2">
<segment>
<source>Number of <ph id="1" dataRef="d1" canCopy="no" canDelete="no" canReorder="no"/>:
<ph id="2" dataRef="d2" canCopy="no" canDelete="no" canReorder="no"/>.</source>
</segment>
<originalData>
<data id="d1">%s</data>
<data id="d2">%d</data>
</originalData>
</unit>See the Target Content
Modification section for additional details on editing.Processing RequirementsExtraction tools should set the canDelete, canCopy and canReorder attributes
for the codes that need to be treated differently than with the
default settings.User agents should not delete inline codes that have their
attribute canDelete set to
no.User agents should not replicate inline codes that have their
attribute canCopy set to
no.When the attribute canReorder is set to
no, the attributes canCopy and canDeletemust also be
set to no.AnnotationsAn annotation is an element that associates a section of the content
with some metadata information.Annotation may be created by the tool that generates the initial
XLIFF document, or by any other user agent later in the process. For
example, after a first tool creates the document, a second tool can
annotate the source content with terminological information.Annotations are represented using the <mrk> element, or the pair of
<sm> and <em> elements.Processing RequirementsWhen a user agent removes a <mrk> element or a pair of
<sm> / <em> elements and the ref attribute is present, it must
check whether or not the URI pointed by the ref attribute is within the same
<unit> as the removed
element. If it is and no other element has a reference to the pointed
element, the user agent must remove the pointed element.Type of AnnotationsThere are several pre-defined types of annotation and user agents
can also define custom
types.Translate AnnotationThis annotation is used to indicate whether a span of content is
translatable or not.Usage:The id attribute is
requiredThe translate attribute is
required and set to yes or noThe type attribute is optional
and set to generic (this is the default value)For example:He saw his <mrk id="m1" translate="no">doppelgänger</mrk>.This annotation overrides the translate attribute set
at the <segment>
level.The translate attribute can
also be used at the same time as another type of annotation. For
example:He saw his <mrk id="m1" translate="no" type="term">doppelgänger</mrk>.Term AnnotationThis annotation is used to mark up a term in the content, and
possibly associate information to it.Usage:The id attribute is
requiredThe type attribute is required
and set to termThe value attribute is optional
and contains a short definition of the termThe ref attribute is optional and
contains a URI pointing to information on the termThe translate attribute is
optional and set to yes or noFor example:<unit id="1">
<segment>
<source>He is my <mrk id="m1" type="term">doppelgänger</mrk>.</source>
<target>Il est mon <mrk id="m1" type="term">alter ego</mrk>.</target>
</segment>
</unit>Comment AnnotationThis annotation is used to associate a span of content with a
comment.Usage:The id attribute is
requiredThe type attribute is required
and set to commentIf the value attribute is present
it contains the text of the comment, otherwise the ref attribute must be present
and contains the id value (in URI format) of a <note> element that
holds the comment.The translate attribute is
optional and set to yes or noFor example, here with the value attribute:The <mrk id="m1" type="comment"
value="Possible values: Printer or Stacker"><ph id="1" dataRef="d1"/></mrk>
has been enabled.And here using the ref attribute:<unit id="1">
<segment>
<source>You use your own namespace.</source>
<target>Vous pouvez utiliser votre propre <mrk id="m1"
type="comment" ref="#n1">namespace</mrk>.</target>
<notes>
<note id="n1" appliesTo="target">Please check the
translation for 'namespace'. On also can use 'espace de nom',
but I think most technical manuals use the English
term.</note>
</notes>
</segment>
</unit>Custom AnnotationThe <mrk> element can be used
to implement custom annotations.A custom annotation must not provide the same functionality as a
pre-defined annotation.Usage:The id attribute is
requiredThe type attribute is required
and set to a unique user-defined value.The translate attribute is
optional and set to yes or noThe use and semantics of the value and ref attributes are
user-defined.For example:One of the earliest surviving works of literature is
<mrk id="m1" type="myCorp:isbn" value="978-0-14-44919-8">The
Epic of Gilgamesh</mrk>.Splitting AnnotationsAnnotations can overlap spanning inline codes or other
annotations. They also can be split by segmentation. Because of this, a
single annotation span can be represented using a pair of <sm> and <em> elements instead of a
single <mrk> element.For example, one can have the following content:<unit id="1">
<segment>
<source>Sentence A. <mrk id="m1" type="comment"
value="Comment for B and C">Sentence B. Sentence C.</mrk></source>
</segment>
</unit>After a user agent performs segmentation, the annotation element
<mrk> is changed to a pair of
<sm> and <em> elements:<unit id="1">
<segment>
<source>Sentence A. </source>
</segment>
<segment>
<source><sm id="m1" type="comment"
value="Comment for B and C"/>Sentence B. </source>
</segment>
<segment>
<source>Sentence C.<em startRef="m1"/></source>
</segment>
</unit>Sub-FlowsA sub-flow is a section of text embedded inside an inline code, or
inside another section of text.For example, the following HTML content includes two sub-flows: The
first one is the value of the title attribute ("Start
button"), and the second one is the value of the alt
attribute ("Click here to start!"):Click to start: <img title="Start button"
src="btnStart.png" alt="Click here to start!"/>Another example is the following DITA content where the footnote
"A Palouse horse is the same as an Appaloosa." is defined at
the middle of a sentence:Palouse horses<fn>A Palouse horse is the same as
an Appaloosa.</fn> have spotted coats.In XLIFF, each sub-flow is stored in its own <unit> element, and the
subFlows attribute is
used to indicate the location of the embedded content.Therefore the HTML content of the example above can be represented
like below:<unit id="1">
<segment>
<source>Start button</source>
</segment>
</unit>
<unit id="2">
<segment>
<source>Click here to start!</source>
</segment>
</unit>
<unit id="3">
<segment>
<source>Click to start: <ph id="1" subFlows="1 2"/></source>
</segment>
</unit>
Processing RequirementsThe extraction tool should store each sub-flow in its own <unit> element.An inline code containing or delimiting one or more sub-flows
must have an attribute subFlows that holds a list
of the identifiers of the <unit> elements where the
sub-flows are stored.The extraction tool may order the <unit> elements of the
sub-flows and the <unit> element of their
parent in any order it sees fit. User agents coming later in the
process must keep the <unit> elements in their
initial order.White SpacesWhile white spaces can be significant or insignificant in the original
format, they are always treated as significant when stored as original
data in XLIFF.Processing RequirementsFor the elements <sc>, <ec>, <ph> and <data>: The white spaces
of their content must be preserved in all cases, even if the value for
xml:space is set or inherited as
default.For the inline content and all other inline elements: The white
spaces must be preserved if the value for xml:space is
set to preserve, and they may be preserved if
the value is set to default.Bidirectional TextText directionality in XLIFF content is defined by inheritance.
Source and target content can have different directionality.The initial directionality for both the source and the target
content is defined in the <file> element, using the
optional attributes srcDir for the source and trgDir for the target. The default
value for both attributes is ltr.The <unit> element has also the
two optional attributes srcDir and trgDir. Their values must be
either ltr or rtl.The default value of the
srcDir is inherited from the value
of the srcDir attribute in the parent
<file> element. The default
value of the trgDir attribute is inherited from
the value of the trgDir attribute in the parent
<file> element.The <source> element has an
optional attribute dir with a value ltr or
rtl. The default value is inherited from the value of the
<unit> in which the element is
located.The <target> element has an
optional attribute dir with a value ltr or
rtl. The default value is inherited from the value of the
<unit> in which the element is
located.The <pc> and <sc> elements have an optional
attribute dir with a value ltr or
rtl. The default value is inherited from the parent <source> or <target> in which the
element is located.Adding bidirectional information in the text content is done using
the Unicode bidirectional control characters.In addition, the <data> element has an optional
attribute dir with a value ltr or
rtl that is not inherited. The default value is
ltr.Target Content ModificationThis section defines the rules tools need to follow when working
with the target content of a given segment in order to provide
interoperability throughout the whole process.The extraction tool can create the initial target content as it sees
fit.The merging tool is assumed to have the same level of processing and
native format knowledge as the extraction tool. Providing an interoperable
way to convert native documents into XLIFF with one tool and back to the
native format with another tool without the same level of knowledge is
outside the scope of this specification.The user agents modifying the target content of a document between
the extraction and the merging tools ensure interoperability by applying
specific rules. These rules are separated into two cases: When there is an
existing target and when there is no existing target.Without an Existing TargetWhen there is no existing target, the processing requirements for
a given segment are the following:Processing RequirementsUser agents may leave the segment without a target.User agents may create a new target as follow:User agents may add translatable text.User agents must put all non-removable inline codes in the
target.User agents must preserve the order of all the non-reorderable inline
codes.User agents may put any removable inline code in the
target.User agents may add inline codes.User agents may add or remove annotations.User agents may split the segment into two
segments.User agents may join the segment with the following
one.User agents may convert any <pc> element into a
pair of <sc> and <ec> elements.User agents may convert, if it is possible, any pair or
<sc> and <ec> elements into a
<pc> element.With an Existing TargetWhen working with a segment with content already in the target,
user agents must choose one of the three behaviors described below:Processing RequirementsUser agents may leave the existing target unchanged.User agents may modify the existing target as follow:User agents may add or modify translatable text.User agents must preserve all non-removable inline codes,
regardless whether or not they exist in the source.User agents must preserve any non-reorderable inline codes in
the existing target.User agents must not add any non-reorderable inline codes to
the target.User agents must not split the segment. The reason to not
allow splitting of segments with content in the target node is
because there is no guarantee that the content in the two nodes
are linguistically in the same order, performing that operation
would pose a risk to the integrity of the content.User agents may remove any removable inline codes in the
target.User agents may add inline codes (including copying any
cloneable inline codes of
the existing target).User agents may add or remove annotations.User agents may join the segment with the following
segment.User agents may convert any <pc> element into a
pair of <sc> and <ec> elements.User agents may convert, if it is possible, any pair or
<sc> and <ec> elements into a
<pc> element.User agents may delete the existing target and start over as
if working without an existing target.Content ComparisonThis specification defines two types of content equality:Equality type A: Two contents are equals if their normalized
forms are equal.Equality type B: Two contents are equals if, in their normalized
forms and with all inline code markers replaced by the value of their
equiv attributes, the resulting
strings are equal.A content is normalized when:The text nodes are in Unicode Normalized Form C defined in the
Unicode Annex #15: Unicode Normalization Forms [LDML].All annotation markers are removed.All pairs of <sc> and <ec> elements that can be
converted into a <pc> element, are
converted.All adjacent text nodes are merged into a single text
node.For all the text nodes with the white space property set to
default, all adjacent white spaces are collapsed into a
single space.Extension MechanismsXLIFF 2.0 offers two mechanisms for storing custom data in an XLIFF document:Using the Metadata
module for storing custom data in elements defined by the official XLIFF
specification.Using the standard XML namespace mechanism for storing data in elements or attributes defined in a custom
XML Schema.Both mechanisms can be used simultaneously.Extension PointsThe following elements allow storing custom data in
<mda:metadata>
elements or in elements from a custom XML namespace:- <file>- <group>- <unit>Custom extensions using
<mda:metadata>
are allowed in:- <segment>- <ignorable>- <mtc:match>The following elements accept custom attributes:- <file>- <group>- <unit>- <segment>- <ignorable>- <source>- <target>- <note>- <mrk>- <sm>Processing RequirementsA user extension, whether implemented using
<mda:metadata>
or using a custom namespace, must not provide the same functionality as an existing XLIFF
core or module feature, however it may complement an extensible XLIFF core feature or module
feature or provide a new funtionality at provided extensin points.Tools must not rely on user extensions (either in the Metadata
module or custim namespace based) other than the ones possibly defined in
<skeleton>
to create the translated version of the original document.
User agents that do not support a given custom namespace based user extension should preserve that extension without
modifications, except if the element where the extension is located is removed.SegmentationIn the context of XLIFF, a segment is a content which is either a unit
of extracted text, or has been created from a unit of extracted text by
means of a segmentation mechanism such as sentence boundary detection. For
example, a segment can be a title, the text of a menu item, a paragraph or a
sentence in a paragraph.In the context of XLIFF, other types representations sometimes called
"segmentation" can be represented using annotations. For example: the terms
in a segment can be identified and marked up using the term
annotation.XLIFF does not specify how segmentation is carried out, only how to
represent its result. The Segmentation Rules eXchange standard [SRX] provides
detailed information about segmenting a content.Segments RepresentationIn XLIFF each segment is represented by a <segment> element.A <unit> can be made of a single
<segment>.Each <segment> element has one
<source> element that
contains the source content and one optional <target> element that can be
empty or contain the translation of the source content at a given
state.Content parts between segments are represented with the <ignorable> element,
which has the same content model as <segment>.For example:<unit id="1">
<segment>
<source>First sentence.</source>
<target>Première phrase.</target>
</segment>
<ignorable>
<source> </source>
</ignorable>
<segment>
<source>Second sentence.</source>
</segment>
</unit>Segments OrderSome applications (e.g. aligner tools) may create segmented content
where the target segments are not in the same order as the source.To be able to map order differences, the <target> element has an
optional order attribute that indicates its position in the
sequence of segments (and inter-segments). Its value is an integer from 1
to N, including the parts between segments.For example, the following HTML documents have the same paragraph
with three sentences in different order:<p lang='en'>Sentence A. Sentence B. Sentence C.</p><p lang='fr'>Phrase B. Phrase C. Phrase A.</p>The
XLIFF representation of the content, after segmentation and alignment,
would be:<unit id="1">
<segment id="1">
<source>Sentence A.</source>
<target order="5">Phrase A.</target>
</segment>
<ignorable>
<source> </source>
</ignorable>
<segment id="2">
<source>Sentence B.</source>
<target order="1">Phrase B.</target>
</segment>
<ignorable>
<source> </source>
</ignorable>
<segment id="3">
<source>Sentence C.</source>
<target order="3">Phrase C.</target>
</segment>
</unit>Segmentation ModificationSegments within the same <unit> may be split, joined or
moved as needed.When modifying the segmentation, the user agents must make sure the
integrity of the relations between segments and associated data (such as
candidate translations, comments, etc.) is preserved.Processing RequirementsWhen merging, joining, or moving <segment> or <ignorable> elements,
the user agent must update, add or remove the order
attributes of the <target> elements as
needed.[[TODO: PRs for how elements and attributes in segment, source,
target should behave when re-segmenting.]]ConformanceXLIFF is an XML vocabulary, thereafter conformant XLIFF documents must be well formed
and valid XML documents.Conformant XLIFF documents must be valid instances of the official Core XML Schema that is
part of this XLIFF specification. As not all aspects of the XLIFF specification can be expressed in terms of XML Schemas,
conformant XLIFF documents must also comply with all requirements indicated in this specification
document.Applications that generate XLIFF documents must generate conformant XLIFF documents
to be considered XLIFF compliant.XLIFF documents may contain custom extensions, as defined in the Extension Mechanisms section.
Applications that process conformant XLIFF files that contain custom extensions are not
required to understand and process non-XLIFF elements or attributes. However, conformant
applications should preserve existing custom extensions when processing conformant XLIFF files,
provided that the elements that contain custom extensions are not removed according to XLIFF processing requirements or the extension's own processing requirements.XLIFF is a format explicitly designed for exchanging data. Thus, a conformant XLIFF
application must be able to accept XLIFF files it generated after those XLIFF files have
been processed by a different tool, provided that the processed files are conformant XLIFF
documents.XML Schemas and CatalogThe grammar of XLIFF 2.0 is defined using eight (8) XML Schemas and one (1) XML catalog. The module schemas are referenced from their respective modules.XML Schemas TreeCore XML Schema
|
+---Candidates Module XML Schema
|
+---Glossary Module XML Schema
|
+---Metadatata Module XML Schema
|
+---Resource Data Module XML Schema
|
+---Change Tracking Module XML Schema
|
+---Size and Length Restriction Module XML Schema
|
+---Validation Module XML SchemaXML Catalog The catalog listed below for reading convenience is accessible at http://docs.oasis-open.org/xliff/xliff-core/v2.0/csd01/schemas/catalog.xml.
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<uri name="urn:oasis:names:tc:xliff:document:2.0" uri="xliff_core_2.0.xsd"/>
<uri name="urn:oasis:names:tc:xliff:changetracking:2.0" uri="modules/change_tracking.xsd"/>
<uri name="urn:oasis:names:tc:xliff:glossary:2.0" uri="modules/glossary.xsd"/>
<uri name="urn:oasis:names:tc:xliff:matches:2.0" uri="modules/matches.xsd"/>
<uri name="urn:oasis:names:tc:xliff:metadata:2.0" uri="modules/metadata.xsd"/>
<uri name="urn:oasis:names:tc:xliff:resourcedata:2.0" uri="modules/resource_data.xsd"/>
<uri name="urn:oasis:names:tc:xliff:sizerestriction:2.0" uri="modules/size_restriction.xsd"/>
<uri name="urn:oasis:names:tc:xliff:validation:2.0" uri="modules/validation.xsd"/>
</catalog>
Core XML Schema The schema listed below for reading convenience is accessible at http://docs.oasis-open.org/xliff/xliff-core/v2.0/csd01/schemas/xliff_core_2.0.xsd.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
xmlns:xlf="urn:oasis:names:tc:xliff:document:2.0"
xmlns:ctr="urn:oasis:names:tc:xliff:changetracking:2.0"
xmlns:gls="urn:oasis:names:tc:xliff:glossary:2.0"
xmlns:mtc="urn:oasis:names:tc:xliff:matches:2.0"
xmlns:mda="urn:oasis:names:tc:xliff:metadata:2.0"
xmlns:res="urn:oasis:names:tc:xliff:resourcedata:2.0"
xmlns:slr="urn:oasis:names:tc:xliff:sizerestriction:2.0"
xmlns:val="urn:oasis:names:tc:xliff:validation:2.0"
targetNamespace="urn:oasis:names:tc:xliff:document:2.0">
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
<xs:import namespace="urn:oasis:names:tc:xliff:changetracking:2.0"
schemaLocation="modules/change_tracking.xsd"/>
<xs:import namespace="urn:oasis:names:tc:xliff:glossary:2.0"
schemaLocation="modules/glossary.xsd"/>
<xs:import namespace="urn:oasis:names:tc:xliff:matches:2.0"
schemaLocation="modules/matches.xsd"/>
<xs:import namespace="urn:oasis:names:tc:xliff:metadata:2.0"
schemaLocation="modules/metadata.xsd"/>
<xs:import namespace="urn:oasis:names:tc:xliff:resourcedata:2.0"
schemaLocation="modules/resource_data.xsd"/>
<xs:import namespace="urn:oasis:names:tc:xliff:sizerestriction:2.0"
schemaLocation="modules/size_restriction.xsd"/>
<xs:import namespace="urn:oasis:names:tc:xliff:validation:2.0"
schemaLocation="modules/validation.xsd"/>
<!-- Attribute definitions -->
<xs:simpleType name="yesNo">
<xs:restriction base="xs:string">
<xs:enumeration value="yes"/>
<xs:enumeration value="no"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="dirValue">
<xs:restriction base="xs:string">
<xs:enumeration value="ltr"/>
<xs:enumeration value="rtl"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="appliesTo">
<xs:restriction base="xs:string">
<xs:enumeration value="source"/>
<xs:enumeration value="target"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="userDefinedValue">
<xs:restriction base="xs:string">
<xs:pattern value="[^\s:]+:[^\s:]+"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="attrType_type">
<xs:restriction base="xs:string">
<xs:pattern value="(fmt|quot|link|image|other)"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="typeForMrkValues">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="generic"/>
<xs:enumeration value="comment"/>
<xs:enumeration value="term"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="attrType_typeForMrk">
<xs:union memberTypes="xlf:typeForMrkValues xlf:userDefinedValue"/>
</xs:simpleType>
<!-- Structural elements -->
<xs:element name="xliff">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="xlf:file"/>
</xs:sequence>
<xs:attribute name="version" fixed="2.0" use="required"/>
<xs:attribute name="srcLang" use="required"/>
<xs:attribute name="tgtLang" use="optional"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
<xs:element name="file">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:skeleton"/>
<xs:element minOccurs="0" maxOccurs="1" ref="gls:glossary"/>
<xs:element minOccurs="0" maxOccurs="1" ref="mda:metadata"/>
<xs:element minOccurs="0" maxOccurs="1" ref="slr:profiles"/>
<xs:element minOccurs="0" maxOccurs="1" ref="slr:data"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="res:resourceData"/>
<xs:element minOccurs="0" maxOccurs="1" ref="validation:validation"/>
<xs:any maxOccurs="unbounded" minOccurs="0" namespace="##other"
processContents="skip"/>
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element ref="xlf:unit"/>
<xs:element ref="xlf:group"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="id" use="optional" type="xs:NMTOKEN"/>
<xs:attribute name="original" use="optional"/>
<xs:attribute name="srcDir" use="optional" type="xlf:dirValue"
default="ltr"/>
<xs:attribute name="trgDir" use="optional" type="xlf:dirValue"
default="ltr"/>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
<xs:attribute ref="slr:storageRestriction" use="optional"/>
<xs:attribute ref="slr:sizeRestriction" use="optional"/>
<xs:attribute ref="slr:sizeInfo" use="optional"/>
<xs:attribute ref="slr:sizeInfoRef" use="optional"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
<xs:element name="skeleton">
<xs:complexType mixed="true">
<xs:sequence>
<xs:any maxOccurs="unbounded" minOccurs="0" namespace="##other"
processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="group">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element ref="xlf:unit"/>
<xs:element ref="xlf:group"/>
</xs:choice>
<xs:element minOccurs="0" maxOccurs="1" ref="mda:metadata"/>
<xs:element minOccurs="0" maxOccurs="1" ref="slr:data"/>
<xs:element minOccurs="0" maxOccurs="1" ref="validation:validation"/>
<xs:any maxOccurs="unbounded" minOccurs="0" namespace="##other"
processContents="skip"/>
</xs:sequence>
<xs:attribute name="id" use="optional" type="xs:NMTOKEN"/>
<xs:attribute name="name" use="optional"/>
<xs:attribute name="srcDir" use="optional" type="xlf:dirValue"/>
<xs:attribute name="trgDir" use="optional" type="xlf:dirValue"/>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
<xs:attribute ref="slr:storageRestriction" use="optional"/>
<xs:attribute ref="slr:sizeRestriction" use="optional"/>
<xs:attribute ref="slr:sizeInfo" use="optional"/>
<xs:attribute ref="slr:sizeInfoRef" use="optional"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
<xs:element name="unit">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element ref="xlf:segment"/>
<xs:element ref="xlf:ignorable"/>
</xs:choice>
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:notes"/>
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:originalData"/>
<xs:element minOccurs="0" maxOccurs="1" ref="mtc:matches"/>
<xs:element minOccurs="0" maxOccurs="1" ref="gls:glossary"/>
<xs:element minOccurs="0" maxOccurs="1" ref="mda:metadata"/>
<xs:element minOccurs="0" maxOccurs="1" ref="slr:data"/>
<xs:element minOccurs="0" maxOccurs="1" ref="validation:validation"/>
<xs:any maxOccurs="unbounded" minOccurs="0" namespace="##other"
processContents="skip"/>
</xs:sequence>
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
<xs:attribute name="name" use="optional" />
<xs:attribute name="translate" use="optional" type="xlf:yesNo" default="yes"/>
<xs:attribute name="srcDir" use="optional" type="xlf:dirValue"/>
<xs:attribute name="trgDir" use="optional" type="xlf:dirValue"/>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
<xs:attribute ref="slr:storageRestriction" use="optional"/>
<xs:attribute ref="slr:sizeRestriction" use="optional"/>
<xs:attribute ref="slr:sizeInfo" use="optional"/>
<xs:attribute ref="slr:sizeInfoRef" use="optional"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
<xs:element name="segment">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" ref="xlf:source"/>
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:target"/>
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:notes"/>
<xs:element minOccurs="0" maxOccurs="1" ref="mtc:matches"/>
<xs:element minOccurs="0" maxOccurs="1" ref="ctr:changeTrack"/>
<xs:element minOccurs="0" maxOccurs="1" ref="validation:validation"/>
<xs:element minOccurs="0" maxOccurs="1" ref="mda:metadata"/>
</xs:sequence>
<xs:attribute name="id" use="optional" type="xs:NMTOKEN"/>
<xs:attribute name="translate" use="optional" type="xlf:yesNo" default="yes"/>
<xs:attribute name="approved" type="xlf:yesNo" default="no"/>
<xs:attribute name="state" use="optional" default="initial"/>
<xs:attribute name="subState" use="optional"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="ignorable">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" ref="xlf:source"/>
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:target"/>
<xs:element minOccurs="0" maxOccurs="1" ref="mda:metadata"/>
</xs:sequence>
<xs:attribute name="id" use="optional" type="xs:NMTOKEN"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="originalData">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="xlf:data"/>
</xs:sequence>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="data">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="xlf:cp"/>
</xs:sequence>
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
<xs:attribute name="dir" use="optional" type="xlf:dirValue"/>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="notes">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="xlf:note"/>
</xs:sequence>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="note">
<xs:complexType mixed="true">
<xs:attribute name="id" use="optional" type="xs:NMTOKEN"/>
<xs:attribute name="appliesTo" use="optional" type="xlf:appliesTo"/>
<xs:attribute name="category" use="optional"/>
<xs:attribute name="priority" use="optional"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="source">
<xs:complexType mixed="true">
<xs:group ref="xlf:inline" minOccurs="0" maxOccurs="unbounded"/>
<xs:attribute ref="xml:lang" use="optional"/>
<xs:attribute ref="xml:space" use="optional"/>
<xs:attribute name="dir" use="optional" type="xlf:dirValue"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="target">
<xs:complexType mixed="true">
<xs:group ref="xlf:inline" minOccurs="0" maxOccurs="unbounded"/>
<xs:attribute ref="xml:lang" use="optional"/>
<xs:attribute ref="xml:space" use="optional"/>
<xs:attribute name="dir" use="optional" type="xlf:dirValue"/>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
<!-- Inline elements -->
<xs:group name="inline">
<xs:choice>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="xlf:sc"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="xlf:ec"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="xlf:ph"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="xlf:pc"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="xlf:cp"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="xlf:mrk"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="xlf:sm"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="xlf:em"/>
</xs:choice>
</xs:group>
<xs:element name="sc">
<!-- Start Code -->
<xs:complexType mixed="false">
<xs:attribute name="canCopy" use="optional" type="xlf:yesNo" default="yes"/>
<xs:attribute name="canDelete" use="optional" type="xlf:yesNo" default="yes"/>
<xs:attribute name="canOverlap" use="optional" type="xlf:yesNo"/>
<xs:attribute name="canReorder" use="optional" type="xlf:yesNo" default="yes"/>
<xs:attribute name="copyOf" use="optional" type="xs:NMTOKEN"/>
<xs:attribute name="disp" use="optional"/>
<xs:attribute name="equiv" use="optional"/>
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
<xs:attribute name="isolated" use="optional" type="xlf:yesNo" default="no"/>
<xs:attribute name="dataRef" use="optional"/>
<xs:attribute name="subFlows" use="optional" type="xs:NMTOKENS"/>
<xs:attribute name="subType" use="optional" type="xlf:userDefinedValue"/>
<xs:attribute name="type" use="optional" type="xlf:attrType_type"/>
<xs:attribute name="dir" use="optional" type="xlf:dirValue"/>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
<xs:attribute ref="slr:storageRestriction" use="optional"/>
<xs:attribute ref="slr:sizeRestriction" use="optional"/>
<xs:attribute ref="slr:equivStorage" use="optional"/>
<xs:attribute ref="slr:sizeInfo" use="optional"/>
<xs:attribute ref="slr:sizeInfoRef" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="ec">
<!-- End Code -->
<xs:complexType mixed="false">
<xs:attribute name="canCopy" use="optional" type="xlf:yesNo" default="yes"/>
<xs:attribute name="canDelete" use="optional" type="xlf:yesNo" default="yes"/>
<xs:attribute name="canOverlap" use="optional" type="xlf:yesNo"/>
<xs:attribute name="canReorder" use="optional" type="xlf:yesNo" default="yes"/>
<xs:attribute name="copyOf" use="optional" type="xs:NMTOKEN"/>
<xs:attribute name="disp" use="optional"/>
<xs:attribute name="equiv" use="optional"/>
<xs:attribute name="id" use="optional" type="xs:NMTOKEN"/>
<xs:attribute name="isolated" use="optional" type="xlf:yesNo" default="no"/>
<xs:attribute name="dataRef" use="optional"/>
<xs:attribute name="startRef" use="optional"/>
<xs:attribute name="subFlows" use="optional" type="xs:NMTOKENS"/>
<xs:attribute name="subType" use="optional" type="xlf:userDefinedValue"/>
<xs:attribute name="type" use="optional" type="xlf:attrType_type"/>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
<xs:attribute ref="slr:equivStorage" use="optional"/>
<xs:attribute ref="slr:sizeInfo" use="optional"/>
<xs:attribute ref="slr:sizeInfoRef" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="ph">
<!-- Placeholder -->
<xs:complexType mixed="false">
<xs:attribute name="canCopy" use="optional" type="xlf:yesNo" default="yes"/>
<xs:attribute name="canDelete" use="optional" type="xlf:yesNo" default="yes"/>
<xs:attribute name="canReorder" use="optional" type="xlf:yesNo" default="yes"/>
<xs:attribute name="copyOf" use="optional" type="xs:NMTOKEN"/>
<xs:attribute name="disp" use="optional"/>
<xs:attribute name="equiv" use="optional"/>
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
<xs:attribute name="dataRef" use="optional"/>
<xs:attribute name="subFlows" use="optional" type="xs:NMTOKENS"/>
<xs:attribute name="subType" use="optional" type="xlf:userDefinedValue"/>
<xs:attribute name="type" use="optional" type="xlf:attrType_type"/>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
<xs:attribute ref="slr:equivStorage" use="optional"/>
<xs:attribute ref="slr:sizeInfo" use="optional"/>
<xs:attribute ref="slr:sizeInfoRef" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="pc">
<!-- Paired Code -->
<xs:complexType mixed="true">
<xs:group ref="xlf:inline" minOccurs="0" maxOccurs="unbounded"/>
<xs:attribute name="canCopy" use="optional" type="xlf:yesNo" default="yes"/>
<xs:attribute name="canDelete" use="optional" type="xlf:yesNo" default="yes"/>
<xs:attribute name="canOverlap" use="optional" type="xlf:yesNo"/>
<xs:attribute name="canReorder" use="optional" type="xlf:yesNo" default="yes"/>
<xs:attribute name="copyOf" use="optional" type="xs:NMTOKEN"/>
<xs:attribute name="dispEnd" use="optional"/>
<xs:attribute name="dispStart" use="optional"/>
<xs:attribute name="equivEnd" use="optional"/>
<xs:attribute name="equivStart" use="optional"/>
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
<xs:attribute name="dataRefEnd" use="optional"/>
<xs:attribute name="dataRefStart" use="optional"/>
<xs:attribute name="subFlowsEnd" use="optional" type="xs:NMTOKENS"/>
<xs:attribute name="subFlowsStart" use="optional" type="xs:NMTOKENS"/>
<xs:attribute name="subType" use="optional" type="xlf:userDefinedValue"/>
<xs:attribute name="type" use="optional" type="xlf:attrType_type"/>
<xs:attribute name="dir" use="optional" type="xlf:dirValue"/>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
<xs:attribute ref="slr:storageRestriction" use="optional"/>
<xs:attribute ref="slr:sizeRestriction" use="optional"/>
<xs:attribute ref="slr:equivStorage" use="optional"/>
<xs:attribute ref="slr:sizeInfo" use="optional"/>
<xs:attribute ref="slr:sizeInfoRef" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="cp">
<!-- Code Point -->
<xs:complexType mixed="false">
<xs:attribute name="hex" use="required"/>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="mrk">
<!-- Annotation Marker -->
<xs:complexType mixed="true">
<xs:group ref="xlf:inline" minOccurs="0" maxOccurs="unbounded"/>
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
<xs:attribute name="translate" use="optional" type="xlf:yesNo" default="yes"/>
<xs:attribute name="type" use="optional" type="xlf:attrType_type"/>
<xs:attribute name="ref" use="optional" type="xs:anyURI"/>
<xs:attribute name="value" use="optional"/>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
<xs:attribute ref="slr:storageRestriction" use="optional"/>
<xs:attribute ref="slr:sizeRestriction" use="optional"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
<xs:element name="sm">
<!-- Start Annotation Marker -->
<xs:complexType mixed="false">
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
<xs:attribute name="translate" use="optional" type="xlf:yesNo" default="yes"/>
<xs:attribute name="type" use="optional" type="xlf:attrType_type"/>
<xs:attribute name="ref" use="optional" type="xs:anyURI"/>
<xs:attribute name="value" use="optional"/>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
<xs:attribute ref="slr:storageRestriction" use="optional"/>
<xs:attribute ref="slr:sizeRestriction" use="optional"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
<xs:element name="em">
<!-- End Annotation Marker -->
<xs:complexType mixed="false">
<xs:attribute name="startRef" use="required"/>
<xs:attribute ref="fs:fs" use="optional"/>
<xs:attribute ref="fs:subFs" use="optional"/>
</xs:complexType>
</xs:element>
</xs:schema>
Translation Candidates ModuleThe source text of a document can be pre-processed against various translation resources
(TM, MT, etc.) to provide translation candidates. This module provides an XLIFF capability to store lists of
possible translations along with information about the similarity of the match, the quality
of the translation, its provenance, etc. Module SpecificationModule NamespaceThe namespace for the Translation Candidates module is: urn:oasis:names:tc:xliff:matches:2.0Module ElementsThe elements defined in the Translation Candidates module are:
<matches> and
<match>.
Tree StructureLegend:1 = one+ = one or more? = zero or one<matches> 1
|
+---<match> +
|
+---<xlf:source> 1
|
+---<xlf:target> 1
|
+---<xlf:originalData> ?
| |
| +---<xlf:data> +
|
+---<mda:metadata> ?
matchesCollection of matches retrieved from any leveraging system (MT, TM, etc.)Contains:- One or more <match> elementsmatchA potential translation suggested for the enclosing
<unit>
or
<segment>
element.Contains:- One <source> element
followed by- One <target>
element followed by- Zero or one <originalData> element followed by- Zero or one <mda:metadata> element.Attributes:- id, optional- origin, optional- similarity, optional- matchQuality, optional- matchSuitability, optional- type, optional- reference, optional
- attributes from any namespace, optionalProcessing Requirements
When a <target>
element is a child of <match>
and the reference
attribute is set to "yes", the optional xml:lang
attribute's value does not need to be equal to the value of the tgtLang
attribute of the enclosing <xliff>
element.
Module AttributesThe attributes defined in the Translation Candidates module are: id, similarity, matchQuality, matchSuitability, origin, type, subtype and reference. idIdentifier - A character string used to identify a <match> element.Value description: NMTOKEN. Default value: undefinedThe value must be unique within the <matches> element.Used in:<match>.similaritySimilarity - indicates the similarity level between the content of the
<source>
child of a
<match>
element and the translatable text being matched.Value description: a decimal number between 0.0 and 100.0.Default value: undefinedUsed in:<match>.matchQualityMatch quality - indicates the quality of the <target> child of a <match> element based on an external benchmark or metric.Value description: a decimal number between 0.0 and 100.0.Default value: undefinedUsed in:<match>.This attribute can carry a human review based metrics score, a Machine Translation
self-reported confidence score etc.matchSuitabilityMatch suitability - indicates the general suitability and relevance of its <match> element with the regard to populating the <target> child of the enclosing <segment> element based on various external benchmarks or
metrics pertaining to both the <source> child of the enclosing <segment> and the <target> child of the <match>.
This attribute is intended to carry a value that can be combined from values provided in
similarity and matchQuality attributes based on an external algorithm.
Value description: a decimal number between 0.0 and 100.0.Default value: undefinedUsed in:<match>.
This attribute is also useful for mapping match-quality as specified in XLIFF 1.2.
Processing RequirementsTools processing this module must make use of matchSuitability for match ordering purposes if the attribute is specified.
originMatch origin - indicates the data origin of a
<match>
element.Value description: Text.Default value: undefinedUsed in:<match>.typeType - Indicates the type of a <match> element, it gives the value providing
additional information on how the match was generated or qualifying further the relevance of the
match. The list of pre-defined values is general and user-specific information can be added
using the subtype attribute.Value description:
Standard ValuesValueDescriptionamAssembled Match: match generated by assembling parts of different translations.
mtMachine Translation: candidate generated by a machine translation system.icmIn Context Match: match for which the context is the same as the context of the
source content. E.g. the source text for both contents is also preceded by an identical
source segment, or both appear as level 2 headings.idmIdentifier-based Match: match that has an identifier identical to the source
content. For example the previous translation of a given UI component with the same
ID.tbTerm Base: match obtained from a terminological database, i.e. the whole segment
matches with a term base entry.tmTranslation Memory: just an ordinary translation memory match.othermatch of a top level type not covered by any of the above definitions
Default value: tmUsed in:<match>subtypeSubtype - Indicates the subtype, i.e. a secondary level type, of a <match> element.Value description:The value is composed of a prefix and a sub-value separated by a character : (U+003A). The
prefix is a string uniquely identifying a collection of values for a specific authority. The
sub-value is any string value defined by an authority. The prefix xlf is reserved for this specification, but no sub-values are defined for it at
this time. Other prefixes and sub-values may be defined by the users.Default value: undefinedUsed in:<match>Processing RequirementsIf the attribute subtype is used, the attribute typemust
be specified as well.If the attribute type is modified, the attribute subtypemust be updated or deleted.referenceReference - Indicates that the <match> is to be used as a reference language. For example, a German translation to be used as reference by a Luxembourgish translator.Value description: Yes or No.Default value: No.Used in:<match>XML Schema The schema listed below for reading convenience is accessible at http://docs.oasis-open.org/xliff/xliff-core/v2.0/csd01/schemas/modules/matches.xsd.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
xmlns:mtc="urn:oasis:names:tc:xliff:matches:2.0"
xmlns:mda="urn:oasis:names:tc:xliff:metadata:2.0"
xmlns:xlf="urn:oasis:names:tc:xliff:document:2.0"
targetNamespace="urn:oasis:names:tc:xliff:matches:2.0">
<xs:import namespace="urn:oasis:names:tc:xliff:document:2.0"
schemaLocation="../xliff_core_2.0.xsd"/>
<xs:import namespace="urn:oasis:names:tc:xliff:metadata:2.0"
schemaLocation="metadata.xsd"/>
<xs:simpleType name="similarity">
<xs:restriction base="xs:decimal">
<xs:minInclusive value="0.0"/>
<xs:maxInclusive value="100.0"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="typeValues">
<xs:restriction base="xs:string">
<xs:enumeration value="am"/>
<xs:enumeration value="ebm"/>
<xs:enumeration value="idm"/>
<xs:enumeration value="ice"/>
<xs:enumeration value="mt"/>
<xs:enumeration value="tm"/>
</xs:restriction>
</xs:simpleType>
<!-- Elements for holding translaton candidates -->
<xs:element name="matches">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded"
ref="mtc:match"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="match">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" ref="xlf:source"/>
<xs:element minOccurs="1" maxOccurs="1" ref="xlf:target"/>
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:originalData"/>
<xs:element minOccurs="0" maxOccurs="1" ref="mda:metadata"/>
</xs:sequence>
<xs:attribute name="id" use="optional" type="xs:NMTOKEN"/>
<xs:attribute name="type" use="optional" type="mtc:typeValues"/>
<xs:attribute name="origin" use="optional"/>
<xs:attribute name="similarity" use="optional" type="mtc:similarity"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
</xs:schema>
Glossary ModuleSimple glossaries, consisting of a list of terms with a definition or translation, can
be optionally embedded in an XLIFF document using the namespace mechanism to include elements
from the Glossary module.Module SpecificationModule NamespaceThe namespace for the Glossary module is: urn:oasis:names:tc:xliff:glossary:2.0Module ElementsThe elements defined in the Glossary module are:
<glossary>,
<glossentry>,
<term>,
<translation> and
<definition>.
Tree StructureLegend:1 = one+ = one or more? = zero or one<glossary> 1
|
+---<glossentry> +
|
+---<term> 1
|
+---<translation> ?
|
+---<definition> ?
glossaryContainer for a list of glossary terms.Contains:- One or more <glossentry>
elements.glossentryGlossary entry.Contains:One <term> element followed by Zero or one <translation>
element followed by Zero or one <definition>
element.Processing RequirementsA <glossentry> element must contain a
<translation> or a
<definition> element
to be valid.termA term in the glossary, expressed in the source language of the enclosing
<xliff> element.Contains:Plain text.translationA translation of the sibling <term>
element expressed in the target language of the enclosing
<xliff> element.Contains:Plain text.definitionOptional definition in plain text for the term stored in the sibling
<term> element.Contains:- Plain text.Attributes- source, requiredModule AttributesThe attribues defined in the Glossary module are: source.XML Schema The schema listed below for reading convenience is accessible at http://docs.oasis-open.org/xliff/xliff-core/v2.0/csd01/schemas/modules/glossary.xsd.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
xmlns:gls="urn:oasis:names:tc:xliff:glossary:2.0"
targetNamespace="urn:oasis:names:tc:xliff:glossary:2.0">
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
<!-- Elements for holding simple glossary data -->
<xs:element name="glossary">
<xs:complexType mixed="false">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="gls:glossentry" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="glossentry">
<xs:complexType mixed="false">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" ref="gls:term"/>
<xs:element minOccurs="0" maxOccurs="1" ref="gls:translation" />
<xs:element minOccurs="0" maxOccurs="1" ref="gls:definition" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="term">
<xs:complexType mixed="true"/>
</xs:element>
<xs:element name="translation">
<xs:complexType mixed="true"/>
</xs:element>
<xs:element name="definition">
<xs:complexType mixed="true">
<xs:attribute name="source" use="required" />
</xs:complexType>
</xs:element>
</xs:schema>
Format Style ModuleThis is intended as a namespace mechanism to carry inside an XLIFF document information needed for generating a quick at a glance html preview of XLIFF content using a predefined set of simple html formatting elements.Module SpecificationFormat Style module consists of just two attributes: fs and subFs. It does not specify any elements.Format Style allows most structural and inline XLIFF core elements to convey basic formatting
information using a predefined subset of HTML formatting elements. It primarily enables the
generation of HTML pages or snippets for preview and review purposes. It must
not be used to prescibe a roundtrip to a source document format.The fs attribute holds the name of an HTML formatting element. If additional style
information is needed, the optional subFs attribute is provided.Module NamespaceThe namespace for the Format style module is: urn:oasis:names:tc:xliff:fs:2.0Module AttributesThe attributes defined in the Format Style module are:
fs,
subFs.
fsFormat style attribute, fs - allows most structural and inline XLIFF core elements to convey
basic formatting information using a predefined subset of HTML formatting elements (for example,
HTML elements names like <script> are not included). It enables the generation of HTML pages
or snippets for preview and review purposes. This attribute is not intended to facilitate round-tripping back into the original
format. If additional style information is needed, the optional subFs attribute is provided.Value description:
fs attribute valuesaanchor b bold text style bdo I18N BiDi over-ride big large text style blockquote long quotation body document body br forced line break button push button caption table caption center shorthand for DIV align=center cite citation code computer code fragment col table column colgroup table column group dd definition description del deleted text div generic language/style container dl definition list dt definition term em emphasis h1 heading h2 heading h3 heading h4 heading h5 heading h6 heading head document head hr horizontal rule html document root element i italic text style imgimage label form field label text legend fieldset legend li list item ol ordered list p paragraph pre preformatted text q short inline quotation s strike-through text style samp sample program output, scripts, etc. select option selector small small text style span generic language/style container strike strike-through text strong strong emphasis sub subscript sup superscript table tbody table body td table data cell tfoot table footer th table header cell thead table header title document title tr table row tt teletype or monospaced text style u underlined text style ul unordered list
Default value: undefined.Used in:<file>,
<unit>, <segment>, <ignorable>, <notes>, <note>,
<originalData>, <data>, <source>, <target>, <cp>, <sc>, <ec>, <ph>, <pc>, <mrk>, <sm> and <em>. Example:To facilitate HTML preview, fs can be applied to XLIFF like this like:<xliff>
<file fs:fs="html">
<unit id="1" fs:fs="div">
<segment>
<source fs:fs="p">Mick Jones renewed his interest in the Vintage <pc id="1" fs:fs="strong">'72 Telecaster Thinline </pc> guitar. <x fs:fs="br" />He says <pc fs:fs="q">I love 'em</pc></source>
</segment>
</unit>
</file>
</xliff>With an XSL stylesheet like this: <xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="*" priority="2">
<xsl:choose>
<xsl:when test="@fs:fs">
<xsl:element name="{@fs:fs}">
<xsl:apply-templates />
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates />
</xsl:otherwise>
</xsl:choose>
</xsl:template>You can generate a an HTML page like this: <html>
<div>
<p>Mick Jones renewed his interest in the Vintage <strong>'72 Telecaster Thinline </strong> guitar. <br/>He says <q>I love 'em</q>
</p>
</div>
</html>subFsSub-format style, subFs - allows extra metadata, like URL for example, to be added in concert
with the fs attribute. The subFs must only be used to carry attribute name/value
comma-delimited pairs for attributes that are valid for the HTML element identified by the
accompanying fs. Example: fs:fs="img" fs:subFs="src,smileface.png". Commas (,) and backslashes (\) in the value part of the pair must be escaped with a
backslash.The subFs attribute is not intended to facilitate round-tripping back into the original format. Value description: IRI. Default value: undefined.Used in:<file>,
<unit>, <segment>, <ignorable>, <notes>, <note>,
<originalData>, <data>, <source>, <target>, <cp>, <sc>, <ec>, <ph>, <pc>, <mrk>, <sm> and <em>. Processing RequirementsIf the attribute subFs is used, the attribute fsmust be specified as well.Metadata Module
The Metadata module provides a mechanism for storing custom metadata using elements
that are part of the official XLIFF specification.
Module SpecificationModule NamespaceThe namespace for the Metadata module is: urn:oasis:names:tc:xliff:metadata:2.0Module ElementsThe elements defined in the Metadata module are: <metadata>, <metagroup>, and <meta>. Tree StructureLegend:1 = one+ = one or more<metadata> 1
|
+---<metagroup> +
|
+---<meta> +
metadataContainer for metadata associated with the enclosing element.Contains:- One or more <metagroup> elementsmetagroupProvides a way to organize metadata into a structured hierarchy.Contains:- One or more <meta> elementsAttributes- category, optional
metaContains:- Untranslatable textAttributes- type, requiredModule AttributesThe attribues defined in the Metadata module are:
category and type.categorycategory - indicates a category for metadata contained in the enclosing <metagroup> element.Default value:undefinedUsed in:<metagroup>.typetype - indicates the type of metadata contained by the enclosing element.Default value:undefinedUsed in:<meta>.XML Schema The schema listed below for reading convenience is accessible at http://docs.oasis-open.org/xliff/xliff-core/v2.0/csd01/schemas/modules/metadata.xsd.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
xmlns:mda="urn:oasis:names:tc:xliff:metadata:2.0"
targetNamespace="urn:oasis:names:tc:xliff:metadata:2.0">
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
<!-- Elements for holding custom metadata -->
<xs:element name="metadata">
<xs:complexType mixed="false">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="mda:metagroup" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="metagroup">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="mda:meta" />
</xs:sequence>
<xs:attribute name="category" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="meta">
<xs:complexType mixed="true">
<xs:attribute name="type" use="required" type="xlf:attrType_type"/>
</xs:complexType>
</xs:element>
</xs:schema>
Resource Data ModuleThe Resource Data module provides a mechanism for referencing external resource data that may need
to be modified or used as contextual reference during translation.Module SpecificationModule NamespaceThe namespace for the Resource Data module is: urn:oasis:names:tc:xliff:resourceData:2.0Module ElementsThe elements defined in the Resource Data module are: <resourceData>, <source>, <target>, and <reference>. Tree StructureLegend:? = zero or one* = zero, one or more<resourceData> *
|
+---<source> ?
|
+---<target> ?
|
+---<reference> *
resourceDataSpecifies the references to external resource data that may need to be modified or used as contextual reference during translation.Contains:- Zero or One <source> element followed by- Zero or One <target> element followed by- Zero, one, or more <reference> elementsAttributes:- id, optional- mimeType, required- context, optional- attributes from any namespace, optionalProcessing RequirementsIf a user agent does not understand how to process the mimeType, or the file it references, the Resource Data module can be ignored, but still must be preserved.The value of the optional id attribute must be unique among all <resourceData> children of the enclosing <file> element.The required mimeType attribute should only be modified or removed if the referenced files are modified or removed.For each instance of <resourceData> containing only <source>:User agents may leave <resourceData> unchanged, e.g. they are not required to create <target> or <reference>.User agents may create <target> or <reference> as a siblings of <source>.sourceReferences the actual resource data that may need to be modified or used as contextual reference during translation.Contains:- This element is always empty.Attributes:- href, required- xml:lang, optional- attributes from any namespace, optionalProcessing RequirementsWhen the optional xml:lang attribute is present, its value must be equal to the value of the srcLang attribute of the enclosing <xliff> element.When the context attribute of <resourceData> is set to yes:User agents may create <source> if not already present.User agents should not modify <source>.User agents may remove <source>.When the context attribute of <resourceData> is set to no:<source> must be present.User agents must not modify <source>.User agents must not remove <source>.targetReferences the localized counterpart of the sibling <source> element.Contains:- This element is always empty.Attributes:- href, required- xml:lang, optional- attributes from any namespace, optionalProcessing RequirementsWhen the optional xml:lang attribute is present, its value must be equal to the value of the tgtLang attribute of the enclosing <xliff> element.When the context attribute of <resourceData> is set to yes:User agents may create <target> if not already present.User agents should not modify <target>.User agents may remove <target>.When the context attribute of <resourceData> is set to no:User agents may create <target> if not already present.User agents may leave <target> unchanged.User agents may modify <target>.User agents may delete <target> and start over as if working without an existing <target>. However <target> cannot be deleted without being replaced.referenceReferences contextual data relating to the sibling <source> and <target> elements, such as a German screenshot for a Luxembourgish translator.Contains:- This element is always empty.Attributes:- href, required- xml:lang, optional- attributes from any namespace, optionalProcessing RequirementsWhen the optional xml:lang attribute is present, its value does not need to be equal to the value of the srcLang or tgtLang attribute of the enclosing <xliff> element.User agents may create <reference> if not already present.User agents should not modify <reference>.User agents may remove <reference>.Module AttributesThe attributes defined in the Resource Data module are: id, xml:lang, mimeType, context, href, and resourceDataId. idIdentifier - A character string used to identify a <resourceData> element.Value description: NMTOKENDefault value: undefinedUsed in:<resourceData>xml:langLanguage - The xml:lang attribute specifies the language variant of the text of a given element.
For example: xml:lang="fr-FR" indicates the French language as spoken in France.Value description: A language code as described in [BCP 47].Default value: undefinedUsed in:<source>,
<target>, and
<reference>.mimeTypeMIME type, mimeType - indicates the type of a resource object. This generally corresponds to
the content type of [RFC 2045], the
MIME specification; e.g. mimeType="text/xml" indicates the resource data is a text file of XML
format.Value description: A MIME type. An existing MIME type must be used from
a list of standard values.Default value: undefinedUsed in:<resourceData>If you cannot use any of the standard MIME type values as specified above, a new MIME type can be registered according to [RFC
2048].contextContextual Information - Indicates whether an external resource is to be used for context only and not modified.Value description: yes or noDefault value: yesUsed in:<resourceData>hrefHypertext Reference, href - IRI referencing an external resource.Value description: IRI.Default value: undefinedUsed in:<source>, <target>, and <reference>resourceDataIdResopurce Data Reference - Holds a reference to an associated <resourceData> element.Value description: An XSD NMTOKEN that must be the value of the id attribute of the <resourceData> element being referenced.Default value: undefinedUsed in:<xlf:unit>Examples:In this example, referenced XML contains resource data for a user interface control. The
control is the container for the text “Load Registry Config” and needs to be resized to
accommodate the increased length of the string due to translation. The res:resourceDataId attribute in the
<unit> element refers to the appropriate <resourceData> element, which references the data to be modified.
The name attribute of the <unit> element serves as the key for a user agent
to associate <source> and <target> text with resource data contained in the referenced
XML.
<file id="1">
<res:resourceData id="r1" mimeType="text/xml" context="no">
<res:source href="resources\en\registryconfig.resources.xml" />
<res:target href="resources\de\registryconfig.resources.xml" />
</res:resourceData>
<unit id="1" name="130;WIN_DLG_CTRL_" res:resourceDataId="r1">
<segment id="1" state="translated">
<source>Load Registry Config</source>
<target>Registrierungskonfiguration laden</target>
</segment>
</unit>
</file>
In this example, referenced images are used for context when translating. The res:ResourceDataRef
attribute in the <unit> element refers to the appropriate
<resourceData> element, which references
the image to be displayed to the user.
<file id="1">
<res:resourceData id="r1" mimeType="image/jpeg" context="yes">
<res:source href="resources\en\registryconfig.resources.jpg" />
<res:target href="resources\de\registryconfig.resources.jpg" />
</res:resourceData>
<unit id="1" name="133;WIN_DLG_CTRL_" res:ResourceDataId="r1">
<segment id="1" state="translated">
<source>Remove Registry Config</source>
<target>Registrierungskonfiguration entfernen</target>
</segment>
</unit>
</file>
XML Schema The schema listed below for reading convenience is accessible at http://docs.oasis-open.org/xliff/xliff-core/v2.0/csd01/schemas/modules/resource_data.xsd.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
xmlns:res="urn:oasis:names:tc:xliff:resourceData:2.0"
targetNamespace="urn:oasis:names:tc:xliff:resourceData:2.0">
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
<xs:element name="resourceData">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" ref="res:source"/>
<xs:element minOccurs="0" maxOccurs="1" ref="res:target"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="res:reference"/>
</xs:sequence>
<xs:attribute name="id" use="optional" type="xs:NMTOKEN"/>
<xs:attribute name="mimeType" use="required"/>
<xs:attribute name="context" use="optional"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
<xs:element name="source">
<xs:complexType mixed="false">
<xs:attribute name="href" use="required"/>
<xs:attribute ref="xml:lang" use="optional"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
<xs:element name="target">
<xs:complexType mixed="false">
<xs:attribute name="href" use="required"/>
<xs:attribute ref="xml:lang" use="optional"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
<xs:element name="reference">
<xs:complexType mixed="false">
<xs:attribute name="href" use="required"/>
<xs:attribute ref="xml:lang" use="optional"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
</xs:schema>
Change Tracking ModuleThe Change Tracking module is used to store revision information for XLIFF elements and attributes.Module SpecificationModule NamespaceThe namespace for the Change Tracking module is: urn:oasis:names:tc:xliff:changeTracking:2.0Module ElementsThe elements defined in the Change Tracking module are: <changeTrack>, <revisions>, <revision>, and <item>. Tree StructureLegend:? = zero or one+ = one or more<changeTrack> ?
|
+---<revisions> +
|
+---<revision> +
|
+---<item> +
changeTrackParent container for change tracking information associated with the enclosing element.Contains:- One or more <revisions> elements.revisionsContainer for logical groups of revisions associated with the enclosing element.Contains:- One or more <revision> elements.Attributes:- appliesTo, required- nid, optional- currentVersion, optional- attributes from any namespace, optionalProcessing RequirementsUser agents may create <revisions> elements with attributes.User agents should not modify <revisions> and its attributes defined in this module,
except in the case where the currentVersion attribute is used.
This attribute should be updated when a new revision becomes the most current.User agents should not remove <revisions> and its attributes defined in this module.When the appliesTo attribute refers to an element that is a multiple instance within
the enclosing element, the nid attribute must be used to reference an individual
instance if and only if the referenced instance has an id. Using <notes> as an example:
<notes>
<note id="n1">new note</note>
<note id="n2">another note</note>
</notes>
<changeTrack>
<revisions appliesTo="note" nid="n1">
<revision><item property="content">old note</item></revision>
</revisions>
</changeTrack>
revisionContainer for specific revisions associated with the enclosing element.Contains:- One or more <item> elements.Attributes:- author, optional- datetime, optional- version, optional- checksum, optional- attributes from any namespace, optionalProcessing RequirementsUser agents may create <revision> elements with attributes.User agents should not modify <revision> and its attributes defined in this module.User agents may remove <revision> and its attributes defined in this module
if and only if there is more than one instance of <revision> present. For example, a user agent can decide
to preserve only the most current revision.When the checksum attribute is used, a user agent should compute
and store the checksum on the initial instance of the element and any revisions being tracked. It should also detect that the current checksum of an element is out of date and allow
the changes to be committed as a new revision or be reverted back to the latest tracked state.itemContainer for a specific revision associated with the enclosing element.Contains:- Text.Attributes:- property, required- attributes from any namespace, optionalProcessing RequirementsUser agents may create <item> elements with attributes.User agents should not modify <item> and its attribute defined in this module.User agents should not remove <item> and its attribute defined in this module,
unless they are removed as part of a <revision> elemnent removed according to its own processiing requirements.Module AttributesThe attributes defined in the Change Tracking module are: appliesTo, author, checksum, currentVersion, datetime, nid, property, and version.
appliesToappliesTo – indicates the XLIFF element to which the change track information
applies.Value description: Any valid XLIFF element name.Default value: undefinedUsed in:<revisions>authorauthor - indicates the user or agent that created or modified the referenced element or its
attributes.Value description: Text.Default value: undefinedUsed in:<revision>.
checksumchecksum – a checksum of the revision data used to detect changes made by non-compliant
XLIFF user agents, such as a manual search and replace operation using a text editor.Value description: A CRC-32 checksum of the revision data.[Editorial Note: ITU reference along with Joachim's pseudocode must be added here..]Default value: undefinedUsed in:<revision>, any XLIFF element that accepts attributes from any namespace.currentVersioncurrentVersion - holds a reference to the most current version of a revision.Value description: An XSD NMTOKEN that must be the value of the version attribute of one of the <revision> elements listed in the same <revisions> element.Default value: noneUsed in:<revisions>.datetimeDate and Time, datetime - indicates the date and time the referenced element or its
attributes were created or modified.Value description: Date in [ISO 8601] format.Default value: undefinedUsed in:<revision>.nidOriginal data reference, nid - holds a reference to a single instance of an element that has
multiple instances within the enclosing element.Value description: An XSD NMTOKEN that must be the value of the id attribute of a single instance of an element that is a multiple instance within the enclosing element.Default value: undefinedUsed in:<revisions>propertyproperty – the type of revision data.Value description: The value must be either content to signify the content of an element, or the name of the attribute relating to the revision data.Default value: noneUsed in:<item>.versionversion - indicates the version of the referenced element or its attributes that were
created or modified.Value description: NMTOKEN.Default value: undefinedUsed in:<revision>. Examples:The following example shows simple change tracking for <source>,
<target>, and
<notes>.
The core elements serve as the current version and previous versions are stored in the Change Tracking module.
<unit id="1">
<segment id="1">
<source ctr:author="system" ctr:datetime="2013-02-15T10:00:00+8:00">
Hello World</source>
<target ctr:author="Erik" ctr:datetime="2013-02-17T11:00:00+8:00">
Hallo Welt</target>
<notes>
<note id="n1" category="instruction" ctr:author="Ryan"
ctr:datetime="2013-02-15T10:30:00+8:00">A formal greeting</note>
<note id="n2" category="request" ctr:author="Erik"
ctr:datetime="2013-02-17T11:30:00+8:00">Please Review</note>
</notes>
<changeTrack>
<revisions appliesTo="source">
<revision author="system" datetime="2013-01-15T10:00:00+8:00">
<item property="content">Hello</item>>
</revision>
<revision author="system" datetime="2012-12-15T10:00:00+8:00">
<item property="content">Hi</item>
</revision>
</revisions>
<revisions appliesTo="target">
<revision author="Erik" datetime="2013-01-17T11:00:00+8:00">
<item property="content">Hallo</item>
</revision>
<revision author="Erik" datetime="2012-12-17T11:00:00+8:00">
<item property="content">Gruesse</item>
</revision>
</revisions>
<revisions appliesTo="note" nid="n1">
<revision author="Ryan" datetime="2012-12-15T10:30:00+8:00">
<item property="content">An informal greeting</item>
<item property="category">comment</item>
</revision>
</revisions>
</changeTrack>
</segment>
</unit>
The following example shows change tracking for <source>,
<target>, and
<notes>
using a checksum to detect changes that may have been made outside of an XLIFF aware user agent. Current versions and previous versions are both stored in the Change Tracking module. A checksum on a core element and the most current version of its revision in the Change Tracking module can be checked to determine the existence of an external revision, for example the addition of an exclamation point in the target string.
<unit id="1">
<segment id="1">
<source ctr:checksum="4A17B156">Hello World</source>
<!-- checksum is no longer valid due to the addition of an exclamation point -->
<target ctr:checksum="50281475">Hallo Welt!</target>
<notes>
<note category="instruction" id="n1" ctr:checksum="59890430">A formal greeting</note>
<note category="comment" id="n2" ctr:checksum="80E3EB9D">Please Review</note>
</notes>
<changeTrack>
<revisions appliesTo="source" currentVersion="r1">
<revision author="system" datetime="2013-02-15T10:00:00+8:00"
version="r1" checksum="4A17B156">
<item property="content">Hello World</item>>
</revision>
<revision author="system" datetime="2013-01-15T10:00:00+8:00"
version="r2" checksum="F7D18982">
<item property="content">Hello</item>>
</revision>
<revision author="system" datetime="2012-12-15T10:00:00+8:00"
version="r3" checksum="F7D18982">
<item property="content">Hi</item>
</revision>
</revisions>
<revisions appliesTo="target" currentVersion="r1">
<revision author="Erik" datetime="2013-02-17T11:00:00+8:00"
version="r1" checksum="50281475">
<item property="content">Hallo Welt</item>
</revision>
<revision author="Erik" datetime="2013-01-17T11:00:00+8:00"
version="r2" checksum="78B31ED5">
<item property="content">Hallo</item>
</revision>
<revision author="Erik" datetime="2012-12-17T11:00:00+8:00"
version="r3" checksum="089D3926">
<item property="content">Gruesse</item>
</revision>
</revisions>
<revisions appliesTo="note" nid="n1" currentVersion="r1">
<revision author="Ryan" datetime="2013-02-15T10:30:00+8:00"
version="r1" checksum="59890430">
<item property="content">A formal greeting</item>
<item property="category">instruction</item>
</revision>
<revision author="Ryan" datetime="2012-12-15T10:30:00+8:00"
version="r2" checksum="885537C1">
<item property="content">An informal greeting</item>
<item property="category">comment</item>
</revision>
</revisions>
</changeTrack>
</segment>
</unit>
XML Schema The schema listed below for reading convenience is accessible at http://docs.oasis-open.org/xliff/xliff-core/v2.0/csd01/schemas/modules/change_tracking.xsd.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
xmlns:ctr="urn:oasis:names:tc:xliff:changeTrack:2.0"
targetNamespace="urn:oasis:names:tc:xliff:changeTrack:2.0">
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
<xs:element name="changeTrack">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="ctr:revisions"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="revisions">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="ctr:revision"/>
</xs:sequence>
<xs:attribute name="appliesTo" use="required" type="xlf:appliesTo"/>
<xs:attribute name="nid" use="optional" type="xs:NMTOKEN"/>
<xs:attribute name="currentVersion" use="optional"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
<xs:element name="revision">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="ctr:item"/>
</xs:sequence>
<xs:attribute name="author" use="optional"/>
<xs:attribute name="datetime" use="optional"/>
<xs:attribute name="version" fixed="2.0" use="required"/>
<xs:attribute name="checksum" use="optional"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
<xs:element name="item">
<xs:complexType mixed="true">
<xs:attribute name="property" use="required"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
</xs:schema>
Size Restriction ModuleThe Size Restriction module provides a mechanism to annotate the XLIFF content with information on storage and general
size restrictions.Module SpecificationIntroductionThe restriction framework has support for two distinct types of restrictions; storage
size restrictions and general size restriction. The reason for this is that it is often
common to have separate restrictions between storage and display / physical
representation of data. Since it would be impossible to define all restrictions here a
concept of restriction profile is introduced. The profiles for storage size and general
size are independent. The information related to restriction profiles are stored in the
processing invariant part of the XLIFF file like the <xlf:file>, <xlf:group> and <xlf:unit> elements and contained within elements
defined in this module. The information regarding the specific restrictions are stored
on the processing invariant parts and on the inline elements as attributes or attributes
referencing data in the elements defined in this module. To avoid issues with
segmentation no information regarding size restrictions is present on <xlf:segment>, <xlf:source> and <xlf:target> elements. The module defines a namespace
for all the elements and attributes it introduce, in the rest of the module
specification elements and atributes are in this namespace unless stated otherwise. In
other parts of the XLIFF specification the prefix "slr" is used to refer to this modules
namespace. For clarity the prefix "xlf" will be used for core XLIFF elements and
attributes. Profile names use the same namespace like naming conventions as parts of the
XLIFF Core specification. The name should be composed of two components separated by a
colon. <authority>:<name>. The authority "xliff" is reserved for profiles defined
by the OASIS XLIFF Technical Committee. Module NamespaceThe namespace for the Size and Length restriction module is:
urn:oasis:names:tc:xliff:sizerestriction:2.0Module ElementsThe elements defined in the Size and Length restriction module are: <profiles>, <normalization> and <data>. Tree StructureLegend:1 = one+ = one or more? = zero or one<profiles> 1
|
+---<normalization> ?
<data> +
profilesThis element selects the restriction profiles to use in the document. If no storage or general profile is specified the default values (empty) of those elements will disable restriction checking in the file.Contains:- Zero or one <normalization> element
followed by- elements from any namespace, optionalAttributes:- generalProfile, optional- storageProfile, optionalProcessing RequirementsAny overall configuration or settings related to the selected profile must be placed in child elements of this element.Data not related to the configuration of the selected profiles must not be placed in this element.normalizationThis element is used to hold the attributes specifying normalization form to apply to storage and size restrictions defined in the standard profiles.Contains:- empty elementAttributes:- general, optional- storage, optionalProcessing RequirementsIf this element is not present no normalization should be performed for the standard profiles.Other profiles may use this element in its specified form but must not add new extensions to it.dataThis elements act as a container for data needed by the specified profile to check the part of the XLIFF document that is a sibling or descendant of a sibling of this element. It is not used by the default profiles.Contains:- elements from any namespace, optionalAttributes:- profile, required- attributes from any namespace, optionalProcessing RequirementsThird party profiles must place all data in this element instead of using other extension points if the data serves no other purpose in the processing of the document.Data not used by the specified profile must not be placed in this element.Module AttributesThe attributes defined in the Size and Length restriction module are: storageProfile, generalProfile, storage, general, profile, storageRestriction, sizeRestriction, equivStorage , sizeInfo and sizeInfoRef. storageProfileThis attribute specifies which profile should be used to check storage size restrictions. Empty means that no restrictions should be applied.Value description: Name of restriction profile to use for storage size restrictions.Default value: emptyUsed in:<profiles>.generalProfileThis attribute specifies which profile should be used to check general size restrictions. Empty means that no restrictions should be applied.Value description: Name of restriction profile to use for general size restrictions.Default value: emptyUsed in:<profiles>.storageThis attribute specifies the normalization to apply for storage size restrictions. The only normalization forms C and D as specified by the Unicode Consortium are supported, see Unicode Standard Annex #15.Value description: normalization to apply.
ValuesValueDescriptionnoneNo additional normalization should be done, content should be used as represented in the document. It is possible that other
agents have already done some type of normalization when modifying content. This means that this setting could give different results depending on what agent(s)
are used to preform a specific action on the document.nfcNormalization Form C should be usednfdNormalization Form D should be used
Default value: "none"Used in:<normalization>.generalThis attribute specifies the normalization to apply for general size restrictions. The only normalization forms C and D as specified by the Unicode Consortium are supported, see Unicode Standard Annex #15.Value description: normalization to apply.
ValuesValueDescriptionnoneNo additional normalization should be done, content should be used as represented in the document. It is possible that other
agents have already done some type of normalization when modifying content. This means that this setting could give different results depending on what agent(s)
are used to preform a specific action on the document.nfcNormalization Form C should be usednfdNormalization Form D should be used
Default value: "none"Used in:<normalization>.profileThis attribute is used on the <data> element to indicate what profile the contents of that element apply to.Value description: Name of a restriction profileDefault value: undefinedUsed in:<data>.storageRestrictionThis attribute specifies the storage restriction to apply to the collection descendants of the element it is defined on.Value description: Interpretation of the value is dependent on selected storageProfile. It must represent the restriction to apply to the indicated sub part of the document.Default value: undefinedUsed in:<file>,
<group>,
<unit>,
<mrk>,
<sm>,
<pc> and
<sc>.
sizeRestrictionThis attribute specifies the size restriction to apply to the collection descendants of the element it is defined on.Value description: Interpretation of the value is dependent on selected generalProfile. It must represent the restriction to apply to the indicated sub part of the document.Default value: undefinedUsed in:<file>,
<group>,
<unit>,
<mrk>,
<sm>,
<pc> and
<sc>.
equivStorageThis attribute provide a means to specify how much storaqge space an inline element will use in the native format. This size contribution is then added to the size contributed by the textual parts.
This attribute is only allowed on the <ec> element if that elemnt has the isolated attribute set to yes. Otherwise the attribute on the paired <sc>
element also cover its partner <ec> element.Value description: Interpretation of the value is dependent on selected storageProfile. It must represent the equivalent storage size represented by the inline element.Default value: undefinedUsed in:<pc>,
<sc>,
<ec>,
<ph> and
sizeInfoThis attribute is used to associate profile specific information to inline elements so that size information can be decoupled from the native format or represented when the native data is not available in the XLIFF document.
It can be used on both inline elements and structural elements to provide information on things like GUI dialog or control sizes, expected padding or margins to consider for size, what font is used for contained text and so on.
This attribute is only allowed on the <ec> element if that elemnt has the isolated attribute set to yes. Otherwise the attribute on the paired <sc>
element also cover its partner <ec> element.Value description: Interpretation of the value is dependent on selected
generalProfile. It
must represent information related to how the element it is attached to
contributes to the size of the text or entity in which it occurs or represents.Default value: undefinedRestriction: at most one of this attribute and sizeInfoRef can occur. Both cannot be specified at the same time.Used in:<file>,
<group>,
<unit>,
<pc>,
<sc> and
<ec> and
<ph>,
sizeInfoRefThis attribute is used to point to data that provide the same function as the sizeInfo attribute does, but with the data stored outside the inline content of the XLIFF segment.
This attribute is only allowed on the <ec> element if that elemnt has the isolated attribute set to yes. Otherwise the attribute on the paired <sc>
element also cover its partner <ec> element.Value description: a reference to data that provide the same information that could be put in a sizeInfo attribute.
The reference must point to an element in a <data> element that is a sibling to the element this attribute is attached to or a sibling to one of its ancestors. Default value: undefinedRestriction: at most one of this attribute and sizeInfo can occur. Both cannot be specified at the same time.Used in:<file>,
<group>,
<unit>,
<pc>,
<sc> and
<ec> and
<ph>,
Standard profilesGeneral restriction profile ”xliff:codepoints”This profile implements a simple string length restriction based on the number of
Unicode code points. It is possible to specify if normalization should be applied
using the <normalization> element
and the general attribute. This profile
make use of the following attributes from this module:sizeRestrictionThe value of this attribute holds the ”maximum” or ”minimum and maximum” size
of the string. Either size must be an integer. The maximum size can also be ’*’
to denote that there is no maximum restriction. If only a maximum is specified
it is implied that the minimum is 0 (empty string). The format of the value is
the optional minimum size and a coma followed by a maximum size
(”[minsize,]maxsize”). The default value is ’*’ which evaluates to a string with
unbounded size.sizeInfoThe value of this attribute is an integer representing how many code points
the element it is set on should be considered to contribute to the total size.
If empty the default for all elements is 0.Storage restriction profiles ”xliff:utf8”, ”xliff:utf16” and
”xliff:utf32”These three profiles define the standard size restriction profiles for the common
Unicode character encoding schemes. It is possible to specify if normalization
should be applied using the <normalization>element and
the storage. All sizes are represented
in 8bit bytes. The size of text for these profiles is the size of the text converted
to the selected encoding without any byte order marks attached. The encodings are
specified by the Unicode Consortium in chapter 2.5 of the
Unicode specification.
ProfilesNameDescriptionxliff:utf8The number of 8bit bytes needed to represent the string encoded
as UTF-8 as specified by the Unicode consortium.xliff:utf16The number of 8bit bytes needed to represent the string encoded
as UTF-16 as specified by the Unicode consortium.xliff:utf32The number of 8bit bytes needed to represent the string encoded
as UTF-32 as specified by the Unicode consortium.
These profiles make use of the following attributes from this module:storageRestrictionThe value of this attribute holds the ”maximum” or ”minimum and maximum” size
of the string. Either size must be an integer. The maximum size can also be ’*’
to denote that there is no maximum restriction. If only a maximum is specified
it is implied that the minimum is 0 (empty string). The format of the value is
the optional minimum size and a coma followed by a maximum size
(”[minsize,]maxsize”). The default value is ’*’ which evaluates to a string with
unbounded size.equivStorageThe value of this attribute is an integer representing how many bytes the
element it is set on should be considered to contribute to the total size. If
empty the default is 0. The <cp> is always converted to its representation in
the profiles encoding and the size of that representation is used as the size
contributed by the <cp>. Third party profilesThe general structure of this module together with the extensibility mechanisms
provided, should lend itself to most size restriction schemes. For example to represent
two dimensional data a profile might adopt using a coordinate style for the values of
the general restriction attributes. Like ”{x,y}” to represent width and height or
”{{x1,y1},{x2,y2}}” to represent a bounding box. It should also be possible to embed
information necessary to drive a display simulator and attach that data to text to do
device specific checking. Or to provide font information and to glyph based general size
checking.ConformanceTo claim conformance to the XLIFF size and length restriction module a tool must meet
the following criteria.must Follow the schema of the XLIFF Core specification and the extensions
provided in this modulemust follow all processing requirements set forth in this module specification
regarding the general use of elements and attributesmust support all standard profiles with normalization set to ”none”should support all standard profiles with all modes of normalizationmay support additional third party profiles for storage or general
restrictionsmust provide at least one of the followingAdd size and length restriction information to a documentIf it supports the specified profile(s) in the document it must
provide a way to check if the size and length restrictions in the
document are met according to the profile(s)XML Schema The schema listed below for reading convenience is accessible at http://docs.oasis-open.org/xliff/xliff-core/v2.0/csd01/schemas/modules/size_restriction.xsd.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
xmlns:slr="urn:oasis:names:tc:xliff:sizerestriction:2.0"
targetNamespace="urn:oasis:names:tc:xliff:sizerestriction:2.0">
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
<!-- Attributes for size and length restriction used on core elements-->
<xs:attribute name="equiv-storage" type="xs:string"/>
<xs:attribute name="size-info" type="xs:string"/>
<xs:attribute name="size-info-ref" type="xs:NMTOKEN"/>
<xs:attribute name="size-restriction" type="xs:string"/>
<xs:attribute name="storage-restriction" type="xs:string"/>
<!-- Elements for size and length restriction -->
<xs:element name="profiles">
<xs:complexType mixed="false">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" ref="slr:normalization" />
<xs:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="skip"/>
</xs:sequence>
<xs:attribute name="generalProfile" use="optional"/>
<xs:attribute name="storageProfile" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="normalization">
<xs:complexType mixed="false">
<xs:attribute name="general" use="optional"/>
<xs:attribute name="storage" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="data">
<xs:complexType mixed="false">
<xs:sequence>
<xs:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="skip"/>
</xs:sequence>
<xs:attribute name="profile" use="required"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
</xs:schema>
Validation ModuleThis module defines a specific set of validation rules that can be applied to target text both globally and locally. Further constraints can be defined that allow rules to be applied to target text based on conditions in the source text or disabled to override a global scope.Module SpecificationModule NamespaceThe namespace for the Validation module is:
urn:oasis:names:tc:xliff:validation:2.0Module ElementsThe elements defined in the Validation module are:
<validation> and
<rule>.Tree StructureLegend:? = zero or one+ = one or more<validation> ?
|
+---<rule> +
validationParent container for a list of rules and constraints to apply to the target text of the enclosing element.Contains:- One or more <rule> elements.Attributes:- attributes from any namespace, optionalProcessing RequirementsWhen the <validation> element occurs at the
<file> level, rules must be applied to all
<target> elements within the scope of that
<file> element, except where overrides are specified at the
<group> or
<unit> level.When <validation> occurs at the
<group> level, rules must be applied to all
<target> elements within the scope of
<group>, except where overrides are specified at the
<unit> level.When <validation> occurs at the
<unit> level, rules must be applied to all
<target> elements within the scope of
<unit>.When <validation> occurs at the <segment> level, rules must be applied to the <target> element within the scope of the <segment>.ruleA specific rule and constraint to apply to the target text of the enclosing element.Contains:- This element is always empty.Attributes:- startsWith, optional- endsWith, optional- occurrences, optional- mustLoc, optional- noLoc, optional- disabled, optional- existsInSource, optional- normalization, optional- attributes from any namespace, optionalProcessing RequirementsExactly one of the following attributes: startsWithendsWithoccurrencesmustLocnoLocmust be used in any one <rule> element.User agents may create <rule> elements.User agents must not modify attributes defined in this module present
in any <rule> element.User agents must not remove either <rule> elements or their attributes defined in this
module.Module AttributesThe attributes defined in the Validation module are:
startsWith,
endsWith,
occurrences,
mustLoc,
noLoc,
disabled,
existsInSource,
normalization,
startsWithTarget text starts with, startsWith - is a test to verify that the target text starts with a
defined value.Value description: TextDefault value: noneUsed in:<rule>Processing RequirementsThe target text must start with the value of startsWith.endsWithTarget text ends with, endsWith - is a test to verify that the target text ends with a
defined value.Value description: TextDefault value: noneUsed in:<rule>Processing RequirementsThe target text must end with the value of endsWith.occurrencesoccurrences - is a test to verify that a certain number of occurences of a specified string
exists in the target text.Value description: Text.Characters left parenthesis ( (U+0028), right parenthesis )
(U+0029), and quotation mark " (U+0022) must be escaped by
enclosing within a pair of quotation marks, " (U+0022). The value
must follow this pattern: "(string)(integer)".
For example: In this occurrences="( )(0)", the value patern
prohibits any occurences of two non-breaking spaces next to each other. Here
occurrences="(:)(1)", exactly one occurrence of the colon is enforced.Default value: noneUsed in:<rule>Processing RequirementsThe target text must contain the integer number of occurences of the string as specified in occurrences.mustLocMust localize, mustLoc - is a test for the presence of a string (substring) in the source
text and a verification that it does not exist in the target text. Alternatively it can be used
to verify presence of a prescribed replacement string in the target text.Value description: Text.Characters left parenthesis ( (U+0028), right parenthesis )
(U+0029), and quotation mark " (U+0022) must be escaped by
enclosing within a pair of quotation marks, " (U+0022). The value
must follow one of two patterns: either mustLoc="string"
or mustLoc="(string)(string)", where the prescribed replacement string is enclosed
within the second pair of parentheses.Default value: noneUsed in:<rule>Processing RequirementsWhen mustLoc contains only one string from the source text,
for example: mustLoc="hello world"; the target text must
not contain that string.When mustLoc contains a string from the source text and a
replacement string for the target text, for example: mustLoc="(Hello world)(Hallo
Welt)"; the target text must
contain that replacement string.noLocNot to localize, noLoc - is a test for the presence of a string (substring) in the source
text and verification that it exists also in the target text.Value description: TextDefault value: noneUsed in:<rule>Processing RequirementsThe target text must contain the string specified by the value of noLoc.disabledDisabled rule, disabled – determines whether a rule must or must not be applied within the
scope of its enclosing element. For example, a rule defined at the <file>
level may be disabled at the <unit> level.This attribute is provided to allow for overriding execution of rules set at higher levels,
see <validation>.Value description: yes or noDefault value: noUsed in:<rule>Processing RequirementsWhen the disabled attribute is set to yes, the rule
must not be applied within the scope of its enclosing element.existsInSourceExists in source, existsInSource – determines whether a target text rule depends on the
rule’s being satisfied in the source text or not. For example, with this attribute set to
yes a test would check if the target text ends with a non-breaking space if and
only if the source text ends with a non-breaking space. The default value no means
that the rule will always be enforced in target text, irrespective if the source text satisfies
it. This attribute is only relevant when used with one of the following attributes: startsWith, endsWith, or occurrences, attributes, it must not be used with either the mustLoc attribute or with the noLoc attribute.Using existsInSource set to
no will have no impact on execution of rules, except for overriding rules
behavior set with existsInSource on a
higher level.Value description: yes or noDefault value: noUsed in:<rule>Processing RequirementsWhen using the existsInSource attribute, exactly one of the following attributes:
startsWithendsWithoccurrencesmust be present within the same <rule> element.
Within one <rule> element,
with the existsInSource attribute set to
yes, the rule must be applied to the target text if and only if the the rule is satisfied
in the source text.When using one of the following attributes:
mustLocnoLoc attribute.
the existsInSource attribute must not be present within the same
<rule> element.
normalizationnormalization - specifies the normalization type to apply when validating a rule. Only the
normalization forms C and D as specified by the Unicode Consortium are supported, see Unicode Standard Annex #15.Value description: The allowed values are are listed in the table below
along with their corresponding types of normalization to be applied.
ValuesValueDescriptionnoneNo normalization should be done.nfcNormalization Form C must be used.nfdNormalization Form D must be used.
Default value: nfcUsed in:<rule>Example:
<file>
<validation>
<rule noLoc="Hello" />
</validation>
<unit>
<source>[Hello World from the XLIFF TC]"</source>
<target>[Hallo Welt vom XLIFF TC]"</target>
<validation>
<rule startsWith="[" existsInSource="yes" />
<rule endsWith="]" existsInSource="yes" />
<rule occurrences="( )(0)" />
<rule mustLoc="(World)(Welt)" />
<rule noLoc="Hello" disabled="yes" />
</validation>
</unit>
</file>
XML Schema The schema listed below for reading convenience is accessible at http://docs.oasis-open.org/xliff/xliff-core/v2.0/csd01/schemas/modules/validation.xsd.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
xmlns:val="urn:oasis:names:tc:xliff:validation:2.0"
targetNamespace="urn:oasis:names:tc:xliff:validation:2.0">
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
<xs:element name="validation">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="val:rule"/>
</xs:sequence>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
<xs:element name="rule">
<xs:complexType mixed="false">
<xs:attribute name="startsWith" use="optional"/>
<xs:attribute name="endsWith" use="optional"/>
<xs:attribute name="occurrences" use="optional"/>
<xs:attribute name="mustLoc" use="optional"/>
<xs:attribute name="noLoc" use="optional"/>
<xs:attribute name="disabled" use="optional"/>
<xs:attribute name="existsInSource" use="optional"/>
<xs:attribute name="normalization" use="optional"/>
<xs:anyAttribute namespace="##any" processContents="skip"/>
</xs:complexType>
</xs:element>
</xs:schema>
AcknowledgementsThe following individuals have participated in the creation of this specification and
are gratefully acknowledged:Amaya, Victor - Oracle Chapman, Helena - IBM Coady, Shirley - MultiCorpora R&D Inc. Comerford, Tom - Individual Estreen, Fredrik - Lionbridge Filip, David - Localisation Research Centre King, Ryan - Microsoft Lieske, Christian - SAP AG Loomis, Steven - IBM Michael, Alan - Microsoft Morado Vazquez, Lucia - Localisation Research Centre O'Donnell, Kevin - Microsoft Ow, Michael - IBM Prause, Ingo - SDL Raya, Rodolfo - Maxprograms Ryoo, Jung Woo - Oracle Savourel, Yves - ENLASO Corporation Schnabel, Bryan - Individual Schurig, Joachim - Lionbridge Stahlschmidt, Uwe - Microsoft Waldhör, Klemens - TAUS Walters, David - IBM Wasala, Asanka - Localisation Research Centre