OASIS XML Localisation Interchange File Format (XLIFF) TC

 View Only

ref value in translation candidates module element

  • 1.  ref value in translation candidates module element

    Posted 04-06-2021 17:20
    Hello team, I have an XLIFF specification question about 'ref' attribute used by <mtc:match> element. http://docs.oasis-open.org/xliff/xliff-core/v2.1/csprd01/xliff-core-v2.1-csprd01.html#candidates_ref 'ref' attribute value is IRI, pointing to a span of text within the same unit, according to this specification. However, I don't understand what is right way to point a span of text with this description. http://docs.oasis-open.org/xliff/xliff-core/v2.1/csprd01/xliff-core-v2.1-csprd01.html#matchAnnotation Above specification is explaining use of <mrk> element to annotate a translation candidate. (BTW, this explanation does not look great, because it does not mention <mrk> element directly at all, and just specifying what attributes are used there. It should state <mrk> element is used for the annotation first.) My question is whether a value 'ref' attribute in <mtc:match> must be pointing a <mrk> element under the same <unit> using the XLIFF fragment identification mechanism always. I understand the use case example in 5.1.4 Translation Candidate Annotation below is a typical use case. ----------------- <unit id="1">   <mtc:matches>     <mtc:match ref="#m1">       <source>He is my friend.</source>       <target>Il est mon ami.</target>     </mtc:match>     <mtc:match ref="#m1">       <source>He is my best friend.</source>       <target>Il est mon meilleur ami.</target>     </mtc:match>   </mtc:matches>   <segment>     <source><mrk id="m1" type="mtc:match">He is my friend.</mrk></source>   </segment>   <segment>     <source>Yet, I barely see him.</source>   </segment> </unit> ----------------- What I don't understand is - the example in 4.3.1.22 isolated. I pasted the example below: -----------------    <file id="f2" xmlns:abc="urn:abc">    <unit id="1">      <mtc:matches>        <mtc:match id="tc01" ref="seg2">          <source><sc id="1" isolated="yes"/>Warning:</source>          <target><sc id="1" isolated="yes"/>Attention :</target>        </mtc:match>      </mtc:matches>      <segment id="seg2">        <source><pc id="1">Warning: File not found.</pc></source>      </segment>    </unit>  </file> ----------------- This example is used for explaining <sc> ans <ec>, and includes <mtc:matches>. In this example, you can see <mtc:match id="tc01" ref="seg2">. I think there are two errors in this example. The first issue is, the value of ref attribute "seg2" is not a valid XLIFF fragment identifier. According to the spec ( http://docs.oasis-open.org/xliff/xliff-core/v2.1/csprd01/xliff-core-v2.1-csprd01.html#fragid ), it should have prefix '#' always. The second issue is, I think the intent of this example is to point the text span '<pc id="1">Warning: File not found.</pc>' in <source> element in <segment id="seg2">. Pointing <segment> element does not look right, because it's not a span of text. Or, are we able to use <mtc:match> to point to a <segment> element? If 'ref' attribute in <mtc:match> can only point to <mrk> element with type="mtc:match", then I think section 5.1.6.5 ref should clearly state the value must point to <mrk> element (with type="mtc:match") within the same unit. If 'ref' attribute can point to any other elements, although it sounds weird, it should explain what element can be used for specifying a span of text, and should provide an extra example. Anyway, can someone clarify the original intent, and precise definition of 'ref' attribute value in <mtc:match> element? Thanks, Yoshito