OASIS XML Localisation Interchange File Format (XLIFF) TC

 View Only

RE: [xliff] Another spec question - processing requirements for state attribute

  • 1.  RE: [xliff] Another spec question - processing requirements for state attribute

    Posted 04-07-2022 00:07
    Hello Yoshito, What the spec tries to say is something like this: 1) If a <segment> does not have <target>, the only possible value for state is initial 2) If <target> is present in <segment>, the value of state cannot be initial. I really don't like how the _expression_ if and only if is used in the specification. It is not as clear as what you can express with two conditions like the ones above. I don't think state can be explicitly set to initial when there is a <target> because the target must contain a translation for the sibling <source>, which means it can't be empty and therefore it can't be in initial state.  And you are probably right about the errors in the examples. We need to validate them all. Regards, Rodolfo -- Rodolfo M. Raya Maxprograms http://www.maxprograms.com -------- Original Message -------- Subject: [xliff] Another spec question - processing requirements for state attribute From: Yoshito Umaoka < yoshito_umaoka@us.ibm.com > Date: Wed, April 06, 2022 7:04 pm To: xliff@lists.oasis-open.org < xliff@lists.oasis-open.org > http://docs.oasis-open.org/xliff/xliff-core/v2.1/os/xliff-core-v2.1-os.html#state   The processing requirements section has a statement:     Writers MUST NOT set the state attribute values to other than the default initial if and only if the <segment> element where the attribute is set doesn't have the <target> child.   I'm struggling to interpret only if part. Above statement seems to tell   If <segment> does not have <target>, writers must not set state attribute other than initial . I understand this requirement. If <segment> has <target>, writers must not set state= initial . This is my interpretation of the part only if .   My interpretation 2 is correct, I think many examples in XLIFF 2.1 seem to violate the processing requirement, because the default value of state attribute is initial .   <segment> (with no attributes) is equivalent to <segment state= initial >, because the default value of state attribute is initial . So the segment like below (found in the XLIFF specification) does not look right, because <segment> status should be interpreted as initial   <xliff xmlns= urn:oasis:names:tc:xliff:document:2.0 version= 2.0     srcLang= en trgLang= fr >   <file id= f1 >     <notes>       <note id= n1 >note for file.</note>     </notes>     <unit id= u1 >       <my:elem xmlns:my= myNamespaceURI id= x1 >data</my:elem>       <notes>         <note id= n1 >note for unit</note>       </notes>       <segment id= s1 >         <source><pc id= 1 >Hello <mrk id= m1 type= term >World</mrk>!</pc>             </source>         <target><pc id= 1 >Bonjour le <mrk id= m1 type= term >Monde</mrk>             ! </pc></target>       </segment>     </unit>   </file> </xliff>   If the processing requirement statement says MUST NOT set the state attribute values to other than the default initial EXPLICITLY , then it somewhat makes sense. But at the same time, from the tool developer's point of view, distinction between implicitly set (default value) or explicitly set is often not clear sometimes. I personally think changing the statement to Writers MUST NOT set the state attribute values to other than the default initial if the <segment> element where the attribute is set doesn't have the <target> child. (dropping only if ) might resolve the conflict. In other words, state= initial can be still used even <target> exists, but if <target> is absent, state must be initial .   Again, is my interpretation wrong?   -Yoshito