Closed ghost closed 8 years ago
I think this one is by design because that whitespace should be ignored unless the source element has xml:space="preserve". If you have text before the pc tag, you won't end up with that whitespace. It's only when the inner xml is an XmlElement that this spacing happens.
Having said that, we'll investigate further and report back our findings.
In the attached zip are two files: a.xlf contains the original source without spaces. b.xlf contains the round-tripped output of a.xlf that shows the spaces added.
The round-trip of b.xlf looks identical to the original b.xlf so this is not a recursive problem. Since xml:space is not specified then "default" is implied which means that whitespace should not be preserved. Thus, we think a.xlf and b.xlf are semantically equivalent and this is not a bug.
When creating an Xliff file from the XliffDocument object with the indentation setting enabled, the library introduces a number of whitespace and newline characters in order to pretty-print the Xliff document.
If the or element contains at the beginning an inline element, then the output file will have the inline element on a new line.
Example:
If we deserialize this Xliff document and serialize it back using the library, then the snippet will be written in the following way:
There should be no whitespaces added before or after the element.