{"record":{"id":"f21f9d3b34f3c179","repo":"symfony/translation","slug":"no-support-implemented-for-loading-xliff-version-s","errorCode":null,"errorMessage":"No support implemented for loading XLIFF version \"%s\".","messagePattern":"No support implemented for loading XLIFF version \"(.+?)\"\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"Util/XliffUtils.php","lineNumber":122,"sourceCode":"        return 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts));\n    }\n\n    private static function getSchema(string $xliffVersion): string\n    {\n        if ('1.2' === $xliffVersion) {\n            $schemaSource = file_get_contents(__DIR__.'/../Resources/schemas/xliff-core-1.2-transitional.xsd');\n            $xmlUri = 'http://www.w3.org/2001/xml.xsd';\n        } elseif (\\in_array($xliffVersion, ['2.0', '2.1'], true)) {\n            // XLIFF 2.1 adds optional modules (Change Tracking, ITS, ...) on top of 2.0.\n            // We validate 2.1 documents against the 2.0 XSD: 2.1 documents that stick to\n            // the 2.0 core load fine; documents that use 2.1-only modules will fail validation.\n            $schemaSource = file_get_contents(__DIR__.'/../Resources/schemas/xliff-core-2.0.xsd');\n            $xmlUri = 'informativeCopiesOf3rdPartySchemas/w3c/xml.xsd';\n        } elseif ('2.2' === $xliffVersion) {\n            $schemaSource = file_get_contents(__DIR__.'/../Resources/schemas/xliff-core-2.2.xsd');\n            $xmlUri = 'informativeCopiesOf3rdPartySchemas/w3c/xml.xsd';\n        } else {\n            throw new InvalidArgumentException(\\sprintf('No support implemented for loading XLIFF version \"%s\".', $xliffVersion));\n        }\n\n        return self::fixXmlLocation($schemaSource, $xmlUri);\n    }\n\n    /**\n     * Internally changes the URI of a dependent xsd to be loaded locally.\n     */\n    private static function fixXmlLocation(string $schemaSource, string $xmlUri): string\n    {\n        static $newPath;\n\n        if (null === $newPath) {\n            $path = __DIR__.'/../Resources/schemas/xml.xsd';\n\n            if (0 !== stripos($path, 'phar://')) {\n                $newPath = self::getFileUrl($path);\n            } elseif ($tmpfile = tempnam(sys_get_temp_dir(), 'symfony')) {","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/symfony/translation/blob/ae9e8a51bc29780d63c7f9efd6005d7c875e100b/Util/XliffUtils.php#L104-L140","documentation":"Thrown by XliffUtils::getSchema() when the XLIFF version detected from the file (via getVersionNumber) has no bundled XSD in this component. Supported versions are 1.2, 2.0, 2.1 and 2.2; anything else is rejected.","triggerScenarios":"validateSchema() called on an XLIFF file whose namespace-derived version is not one of the supported strings, e.g. version '1.0', '2.3' or garbage after the namespace prefix.","commonSituations":"Files claiming exotic XLIFF versions, corrupted version attributes, or XLIFF 1.1 exports from legacy tools.","solutions":["Convert the file to XLIFF 1.2 or 2.x (2.0/2.1/2.2)","Correct the version/namespace attributes in the root <xliff> element","Skip schema validation (avoid validateSchema) and load with the appropriate loader, upgrading the format if needed"],"exampleFix":"// before\n<xliff xmlns=\"urn:oasis:names:tc:xliff:document:1.1\" version=\"1.1\">\n// after\n<xliff xmlns=\"urn:oasis:names:tc:xliff:document:1.2\" version=\"1.2\">","handlingStrategy":"validation","validationCode":"$version = XliffUtils::getVersionNumber($dom);\nif (!in_array($version, ['1.2','2.0','2.1','2.2'], true)) {\n    // convert the file or skip schema validation\n}","typeGuard":null,"tryCatchPattern":"try {\n    XliffUtils::validateSchema($dom);\n} catch (InvalidArgumentException $e) {\n    if (str_contains($e->getMessage(), 'No support implemented')) {\n        // migrate the file to a supported XLIFF version\n    }\n}","preventionTips":["Standardize on XLIFF 1.2 or 2.x exports","Check the version attribute before running validateSchema","Migrate legacy XLIFF 1.0/1.1 files with a conversion tool"],"tags":["php","symfony","translation","xliff","xsd"],"backgroundTag":"unsupported-enum-value","analyzedSha":"ae9e8a51bc29780d63c7f9efd6005d7c875e100b","analyzedAt":"2026-09-15T22:29:15.305Z","contentChangedAt":"2026-09-15T22:29:15.305Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}