Examples

Simple Unit

A simple unit with one translated segment and one ignorable element. The unit includes also an extended attribute.

<?xml version="1.0"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.1" srcLang="en" trgLang="fr">
<file id="f1">
 <unit id="u1" xmlns:my="myNS" my:xattr="extValue">
  <originalData>
   <data id="d1">[C1/]</data>
   <data id="d2">[C2]</data>
   <data id="d3">[/C2]</data>
  </originalData>
  <segment canResegment="no" state="translated">
   <source><ph id="c1" dataRef="d1"/> aaa <pc id="c2" dataRefEnd="d3" dataRefStart="d2">text</pc></source>
   <target><ph id="c1" dataRef="d1"/> AAA <pc id="c2" dataRefEnd="d3" dataRefStart="d2">TEXT</pc></target>
  </segment>
  <ignorable>
   <source>.  </source>
  </ignorable>
 </unit>
</file>
</xliff>

Possible JSON representations of the unit element (Yves)

{
        "id": "u1",
        "myNS:xattr": "extValue",
        "parts": [{
                "seg": true,
                "state": "translated",
                "canResegment": false,
                "source": [{
                        "kind": 2,
                        "id": "c1",
                        "data": "[C1\/]"
                }, " aaa ", {
                        "kind": 0,
                        "id": "c2",
                        "data": "[C2]"
                }, "text", {
                        "kind": 1,
                        "id": "c2",
                        "data": "[\/C2]"
                }],
                "target": [{
                        "kind": 2,
                        "id": "c1",
                        "data": "[C1\/]"
                }, " AAA ", {
                        "kind": 0,
                        "id": "c2",
                        "data": "[C2]"
                }, "TEXT", {
                        "kind": 1,
                        "id": "c2",
                        "data": "[\/C2]"
                }]
        }, {
                "seg": false,
                "source": [".  "]
        }]
}

Possible JSON representations of the unit element (Ryan 1st suggestion)

{
        "id": "u1",
        "myNS:xattr": "extValue",
        "segment": {
                "state": "translated",
                "canResegment": false,
                "source": [{
                        "id": "c1",
                        "standaloneCode": "[C1\/]"
                }, " aaa ", {
                        "id": "c2",
                        "spanningCodeStart": "[C2]"
                }, "text", {
                        "id": "c2",
                        "spanningCodeEnd": "[\/C2]"
                }],
                "target": [{
                        "id": "c1",
                        "standaloneCode": "[C1\/]"
                }, " AAA ", {
                        "id": "c2",
                        "spanningCodeStart": "[C2]"
                }, "TEXT", {
                        "id": "c2",
                        "spanningCodeEnd": "[\/C2]"
                }]
        },
        "ignorable": {
                "source": [".  "]
        }
}

Possible JSON representations of the unit element (Ryan 2nd suggestion)

{
        "class": "unit",
        "id": "u1",
        "myNS:xattr": "extValue",
        "classes": [{
                "class": "segment",
                "state": "translated",
                "canResegment": false,
                "source": [{
                        "id": "c1",
                        "standaloneCode": "[C1\/]"
                }, " aaa ", {
                        "id": "c2",
                        "spanningCodeStart": "[C2]"
                }, "text", {
                        "id": "c2",
                        "spanningCodeEnd": "[\/C2]"
                }],
                "target": [{
                        "id": "c1",
                        "standaloneCode": "[C1\/]"
                }, " AAA ", {
                        "id": "c2",
                        "spanningCodeStart": "[C2]"
                }, "TEXT", {
                        "id": "c2",
                        "spanningCodeEnd": "[\/C2]"
                }]
        }, {
                "class": "ignorable",
                "source": [".  "]
        }]
}

Examples (last edited 2016-06-06 17:05:59 by ryanki)