XliffParser
class XliffParser extends AbstractXmlParser (View source)
A class which parses XLIFF file to simple but useful array representation.
As for now, this class supports only basic XLIFF specification.
- it uses only first "file" tag
- it does support groups only as defined in [2] in order to support plural forms
- reads only "source" and "target" in "trans-unit" tags
Properties
protected array | $parsedFiles | Associative array of "filename => parsed data" pairs. |
from AbstractXmlParser |
Methods
Returns parsed representation of XML file.
Reads and parses XML file and returns internal representation of data.
Returns array representation of XLIFF data, starting from a root node.
No description
Details
array
getParsedData(string $sourcePath)
Returns parsed representation of XML file.
Parses XML if it wasn't done before. Caches parsed data.
protected SimpleXMLElement
getRootNode(string $sourcePath)
No description
protected array
parseXmlFile(string $sourcePath)
Reads and parses XML file and returns internal representation of data.
protected array
doParsingFromRoot(SimpleXMLElement $root)
Returns array representation of XLIFF data, starting from a root node.
protected array
getFileData(SimpleXMLElement $file)
No description
array|null
getFileDataFromDocument($sourcePath, $fileOffset)
No description