Space in front of slash of self-closing tag

I'm translating an XML file with self-closing tags using a custom XML2 filet type.

For example:

<decvar/>

<displayfeedback linkrefid="0"/>

When I generate my output, Trados Studio adds a space in front of the slash of self-closing tags.

For example:

<decvar />

<displayfeedback linkrefid="0" />

This space is breaking the import in the native application.

The workaround is to manually fix it by find and replace, but it's tedious. Is there a setting in Trados Studio I can tweak to avoid the space?

Parents
  • Hi and @daniel,

    Thanks for the contributions!

    Firstly, I fully agree that the client's application should be more robust and mature enough to handle the space. I politely told them that, but they don't improve their application. I'm not in a position to insist (you know, don't bite the hand that feeds you...)

    The whitespace settings of the file types don't seem to do anything... Looking at the docs, I think it's about replacing whitespaces in XML elements by one single space.

    I found the same stackoverflow article, and I also used a manual find&replace as a workaround. However, the files come in daily batches, with a complicated folder structure. I want to avoid any manual effort, because it's silly work and error prone. I liked the idea of a CleanUp batch task (added to a batch task sequence), but again, all 4 colleagues need to remember to pick the right one for this specific customer.

    Luckily, there's a weird solution: The XML2 file types add the space, but the old XML 1.3 (Embedded content) do not... So, I had to recreate the XML file type in the old flavour, which seems to work fine!

Reply
  • Hi and @daniel,

    Thanks for the contributions!

    Firstly, I fully agree that the client's application should be more robust and mature enough to handle the space. I politely told them that, but they don't improve their application. I'm not in a position to insist (you know, don't bite the hand that feeds you...)

    The whitespace settings of the file types don't seem to do anything... Looking at the docs, I think it's about replacing whitespaces in XML elements by one single space.

    I found the same stackoverflow article, and I also used a manual find&replace as a workaround. However, the files come in daily batches, with a complicated folder structure. I want to avoid any manual effort, because it's silly work and error prone. I liked the idea of a CleanUp batch task (added to a batch task sequence), but again, all 4 colleagues need to remember to pick the right one for this specific customer.

    Luckily, there's a weird solution: The XML2 file types add the space, but the old XML 1.3 (Embedded content) do not... So, I had to recreate the XML file type in the old flavour, which seems to work fine!

Children
No Data