XLIFF file exporter changes Node tree when elements have no text nodes present:
<a><svg><image/></svg></a> becomes <a></a><svg></svg><image></image>

The problem seems to be in XLIFF.php processForExport function since $_info['value'] == $_info['built_text'] hits immediately.

As a solution I propose to add field to tray structure, like children_left.
When adding tray new element - fill up children_left with a number of immediate children
Add condition $_info[children_left] == 0, and after tray removal, decrease children_left for immediate parent.
This should keep elements from closing until all their immediate children are processed and preserve node tree structure for such cases

Comments

Konstantin.Savkov.acronis’s picture

Issue summary: View changes