Issue Bug Closed

#108032The state attribute is not assigned to the correct tag in XLIFF 2.x files

Julian Schuierer 11/10/25, 17:06 updated 12/02/25, 12:04

Description

The state attribute in XLIFF 2.x files must be stated in the <segment> tag, currently it is implemented in the <target> tag and fails XLIFF 2.x validation (e.g. with https://dev.maxprograms.com/Validation/)

Wrong assignment

<?xml version="1.0" encoding="utf-8"?>
<xliff version="2.0" xmlns="urn:oasis:names:tc:xliff:document:2.0" srcLang="en" trgLang="de">
    <file id="f1">
        <unit id="adminPanel.copyMarkup">
            <segment>
                <source>Copy markup></source>
                <target state="initial">Kopiere Markup</target>
            </segment>
        </unit>
    </file>
</xliff>

Validation output:

File "locallang.xlf" is not valid XLIFF.
Reason: cvc-complex-type.3.2.2: Attribute 'state' is not allowed to appear in element 'target'.

Correct assignment

<?xml version="1.0" encoding="utf-8"?>
<xliff version="2.0" xmlns="urn:oasis:names:tc:xliff:document:2.0" srcLang="en" trgLang="de">
    <file id="f1">
        <unit id="adminPanel.copyMarkup">
            <segment state="initial">
                <source>Copy markup></source>
                <target>Kopiere Markup</target>
            </segment>
        </unit>
    </file>
</xliff>

Validation output:

File "locallang.xlf" is valid XLIFF 2.0

Reviews 2