Translation/Exporter/XliffExporter.php
protected function addRootNodes(\DOMDocument $dom, $targetLanguage = null)
    {
        $xliff = $dom->appendChild($dom->createElement('xliff'));
        $xliff->appendChild(new \DOMAttr('xmlns', 'urn:oasis:names:tc:xliff:document:1.2'));
        $xliff->appendChild(new \DOMAttr('version', '1.2'));

        $fileNode = $xliff->appendChild($dom->createElement('file'));
        $fileNode->appendChild(new \DOMAttr('source-language', 'en'));
        $fileNode->appendChild(new \DOMAttr('datatype', 'plaintext'));
        $fileNode->appendChild(new \DOMAttr('original', 'file.ext'));

        if (!is_null($targetLanguage)) {
            $fileNode->appendChild(new \DOMAttr('target-language', $targetLanguage));
        }

        $bodyNode =  $fileNode->appendChild($dom->createElement('body'));

        return $bodyNode;
    }
protected function addRootNodes(\DOMDocument $dom, $targetLanguage = null)
    {
        $xliff = $dom->appendChild($dom->createElement('xliff'));
        $xliff->appendChild(new \DOMAttr('xmlns', 'urn:oasis:names:tc:xliff:document:1.2'));
        $xliff->appendChild(new \DOMAttr('version', '1.2'));

        $fileNode = $xliff->appendChild($dom->createElement('file'));
        $fileNode->appendChild(new \DOMAttr('source-language', 'en'));
        $fileNode->appendChild(new \DOMAttr('datatype', 'plaintext'));
        $fileNode->appendChild(new \DOMAttr('original', 'file.ext'));

        if (!is_null($targetLanguage)) {
            $fileNode->appendChild(new \DOMAttr('target-language', $targetLanguage));
        }

        $bodyNode =  $fileNode->appendChild($dom->createElement('body'));

        return $bodyNode;
    }
protected function addRootNodes ( \ DOMDocument $ dom , $ targetLanguage = null ) { $ xliff = $ dom -> appendChild ( $ dom -> createElement ( 'xliff' ) ) ; $ xliff -> appendChild ( new \ DOMAttr ( 'xmlns' , 'urn:oasis:names:tc:xliff:document:1.2' ) ) ; $ xliff -> appendChild ( new \ DOMAttr ( 'version' , '1.2' ) ) ; $ fileNode = $ xliff -> appendChild ( $ dom -> createElement ( 'file' ) ) ; $ fileNode -> appendChild ( new \ DOMAttr ( 'source-language' , 'en' ) ) ; $ fileNode -> appendChild ( new \ DOMAttr ( 'datatype' , 'plaintext' ) ) ; $ fileNode -> appendChild ( new \ DOMAttr ( 'original' , 'file.ext' ) ) ; if ( ! is_null ( $ targetLanguage ) ) { $ fileNode -> appendChild ( new \ DOMAttr ( 'target-language' , $ targetLanguage ) ) ; } $ bodyNode = $ fileNode -> appendChild ( $ dom -> createElement ( 'body' ) ) ; return $ bodyNode ; }
Add root nodes to a document.

@param \DOMDocument $dom
@param string|null $targetLanguage
@return \DOMElement
Add root nodes to a document .