Skip to content

xml:lang attribute should be allowed on some other elements than <source> and <target> #26

@rabularca

Description

@rabularca

Currently, the validator incorrectly throws an exception if xml:lang attribute is found on elements such as <xliff> or <file>. Checking the xsd schema for the <xliff> attribute, we see that only the xml:space attribute is specifically noted, but the line <xs:anyAttribute namespace="##other" processContents="lax"/> means that any other attribute from other namespace than the target namespace (which is urn:oasis:names:tc:xliff:matches:2.0). Considering that the xml:lang attribute falls into that category, the following file should be valid:

<?xml version="1.0"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang='fr-FR' xml:lang="fr-FR">
 <file id="f1">
  <unit id="1">
   <segment>
    <source>source</source>
   </segment>
  </unit>
 </file>
</xliff>

To make sure, I have checked the file and the official xsd http://docs.oasis-open.org/xliff/xliff-core/v2.0/os/schemas/xliff_core_2.0.xsd against some online validators and all of them said that the file is valid.

xsd_validation

Also, besides <xliff>, the following elements from Core should support xml:lang and other namespace attributes: <file>, <group>, <unit>, <note>, <ph>, <pc>, <sc>, <ec>, <mrk> and <sm>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions