class XliffUtils

Provides some utility methods for XLIFF translation files, such as validating their contents according to the XSD schema.

Methods

static string
getVersionNumber(DOMDocument $dom)

Gets xliff file version based on the root "version" attribute.

static array
validateSchema(DOMDocument $dom)

Validates and parses the given file into a DOMDocument.

static string
getErrorsAsString(array $xmlErrors)

No description

Details

static string getVersionNumber(DOMDocument $dom)

Gets xliff file version based on the root "version" attribute.

Defaults to 1.2 for backwards compatibility.

Parameters

DOMDocument $dom

Return Value

string

Exceptions

InvalidArgumentException

static array validateSchema(DOMDocument $dom)

Validates and parses the given file into a DOMDocument.

Parameters

DOMDocument $dom

Return Value

array

Exceptions

InvalidResourceException

static string getErrorsAsString(array $xmlErrors)

Parameters

array $xmlErrors

Return Value

string