XML File Parser losing leading spaces

Hi,

I have a simple XML file for which I have prepared a Trados parser.

<Values>

<Value>Test1</Value>

<Value> Test2</Value>

<Value text="Test3"/>

<Value text=" Test4"/>

</Values>

When I load this file into a Trados project, making sure the correct parser is used, I lose the leading space in the source text. This really matters to me because I am applying Perfect Match sdlxliff files which DO have the leading spaces. I have 2000+ files for each of 14 target languages. Currently, I am seeing a lot of untranslated segments because of this.

It does not matter if the leading space is in an attribute or in an element, the space(s) is lost.

I have edited the parser and tried all 4 "Whitespace" permutations - I get the same result - the spaces are lost.

Am I missing a config setting somewhere or is this a bug?

Best Regards

Mark

emoji
Parents
  •  

    It does not matter if the leading space is in an attribute or in an element, the space(s) is lost.

    I think is probably the wrong choice of words because the spaces are not lost, they are just not needed.  If you use View all Content with a filter you'll see this:

    Screenshot of Trados Studio showing a list with four test segments labeled Test1, Test2, Test3, and Test4, with visible leading spaces before the text in segments 1 and 3.

    The spaces have been moved outside because there is normally no reason for them to be in the segment.  In fact putting them in there is more likely to lead to problems as thy would be easily missed, or even deliberately corrected.

    If I translate this file, save the target, then all the spaces are retained.

    If I then create a new project and use Perfect Match against the original then the spaces are similarly still there in the new target file.

    So your problem is that you have an sdlxliff file where the spaces were not moved externally and now you are presumably creating projects with something different to the way the original one was created and now Perfect Match isn't perfect anymore.

    I'm not sure how to work around this without seeing a simple example of exactly what you're faced with, but it would have to be a workaround to deal with files that are simply prepared in different ways as this isn't a bug.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 10:30 AM (GMT 0) on 29 Feb 2024]
Reply
  •  

    It does not matter if the leading space is in an attribute or in an element, the space(s) is lost.

    I think is probably the wrong choice of words because the spaces are not lost, they are just not needed.  If you use View all Content with a filter you'll see this:

    Screenshot of Trados Studio showing a list with four test segments labeled Test1, Test2, Test3, and Test4, with visible leading spaces before the text in segments 1 and 3.

    The spaces have been moved outside because there is normally no reason for them to be in the segment.  In fact putting them in there is more likely to lead to problems as thy would be easily missed, or even deliberately corrected.

    If I translate this file, save the target, then all the spaces are retained.

    If I then create a new project and use Perfect Match against the original then the spaces are similarly still there in the new target file.

    So your problem is that you have an sdlxliff file where the spaces were not moved externally and now you are presumably creating projects with something different to the way the original one was created and now Perfect Match isn't perfect anymore.

    I'm not sure how to work around this without seeing a simple example of exactly what you're faced with, but it would have to be a workaround to deal with files that are simply prepared in different ways as this isn't a bug.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 10:30 AM (GMT 0) on 29 Feb 2024]
Children
  • Hi Paul, 

    Well you live and learn! Sure enough, I created a Trados project with the above file and did a translate, then did a generate and the leading space is re-inserted into the output document.

    Comparing the SDLXLIFF generated by Trados with the SDLXLIFF generated by Passolo, I can see that the Trados segment does not have the leading space, and the Passolo segment does have the leading space.

    If I use the Passolo export as-is, then I do not get a perfect match.

    if I edit the Passolo export to match the Trados SDLXLIFF file, I get a perfect match.

    So I need to write something to strip out the extra leading spaces from the Passolo SDLXLIFF files before using them against a Trados project.

    I will get in touch with the Passolo guys to see if they can align the SDLXLIFF export feature to write the same SDLXLIFF as Trados - these Passolo export files are supposed to be used with Trados after all.

    Best Regards

    Mark 

    emoji