Below the step to reproduce the issue:
Open a XLIFF 2.0 document with multiple segments defined in one unit (you can use the attached file)
write a note for one segment and save the file
Reopen the file: the note is assigned to every segment defined in that unit,
According to the XLIFF 2.0 spec the following statements are true:
A <unit> element can contain many segments
The <unit> element is the lowest level in the XLIFF tree structure that can contain a <notes> element
A <note> element can have the following attributes:
appliesTo: “source” or “target”
So there is not a straightforward way to refer to a specific segment from a note element and at the moment Ocelot is not able to assign the note to the proper segment.
Yves suggests to use the comment annotations and segments having notes will look like the following
<target><mrk id="m1" type="comment" ref="#n=ocelot-1">Sentence 1.<mrk id="2" itsrovenanceRecordsRef="#its=p1" translate="no" type="its:any">Prov</mrk> Sentence 2.</mrk></target>
where "ocelot-1" is the id of the specific note element.
The implementation for XLIFF 2.0 files having just one segment per unit is unchanged.
When more than one segment per unit exists, the solution suggested by Yves has been implemented. The comment marker is added to the source fragment because the target could not exist.