XML 1.2.0.0 parser - Embedded Content rules not available for the attributes. Is it even possible in Trados?

Is it possible to apply rules set in Embedded content of XML parser for the attributes as well? I need to remove unwanted content from some attributes, but it seems that the embedded content rules can be applies just for the elements. Is this option available in any new parser? I used XML 1.2.0.0 parser.

Example:

I would like to rule out all the content from the attribute formula which is in square brackets(green):


<calculation class='wide' formula='{ FIXED [Customer ID], YEAR([Order Date]):&#13;&#10;COUNTD([Order ID])}' />


I can make some regex to mark up the text in green as translatable, or the other way, I can mark up the rest as Not translatable. Either way, I cannot use these rules to be applied for any attributes. For the same content in elements, it works without any issues.

Are there any XML file types which could allow user to make a custom rules even for attributes?

Thanks for any advice.




[edited by: Paul at 11:19 PM (GMT 0) on 25 Mar 2022]
emoji
Parents
  • Is it possible to apply rules set in Embedded content of XML parser for the attributes as well?

    I'm afraid this isn't possible with the old version of the filetype you are using.

    Are there any XML file types which could allow user to make a custom rules even for attributes?

    Yes.  In Trados Studio 2021 with the new XML2 filetype you can do this.  For example I created this simple file:

    <?xml version="1.0" encoding="UTF-8"?>
    <atts>
      <title translate="n" >Soldier Freddy - Poem by Spike Milligan</title>
        <verse1>
          <text line="<b>Soldier</b>Freddy" />
          <text line="was never ready," />
          <text line="But! Soldier Neddy," />
          <text line="unlike Freddy" />
          <text line="Was always ready" />
          <text line="and steady," />
        </verse1>
        <verse2>
          <text line="That's why," />
          <text line="When Soldier Neddy" />
          <text line="Is-<b>outside</b>-Buckingham-Palace-on-<b>guard</b>-in -the-pouring-wind-and-rain-being-steady-and-ready," />
          <text line="Freddy" />
          <text line="is home in beddy." />
        </verse2>
    </atts>

    I added a couple of embedded content parts to two of the lines in the attributes. I then used one rule to extract the attributes:

    Trados Studio options menu showing XML parser rule for 'text' element with 'line' attribute set to always translatable.

    Then used the html embedded content processor to handle the tags I added to these attribute values:

    Trados Studio embedded content settings with parser rule for 'text' element and HTML embedded content processor selected.

    Resulting in this where segments #2 and #11 have been processed using the embedded content processor:

    Preview of XML file in Trados Studio with embedded HTML tags in attributes, showing processed segments #2 and #11.

    Or even better if I hide the file tags...

    Trados Studio translation view with segments #2 and #11 highlighted, indicating processing by HTML embedded content processor.

    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



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

    thanks for the answer, this is what I was looking for. Is it possible to use the XML2 filetype also in older version of Trados? Or it is just native filetype of 2021 version?

    emoji
  • Is it possible to use the XML2 filetype also in older version of Trados? Or it is just native filetype of 2021 version?

    It's also available with the 2019 version.  But earlier versions won't have it, and it's also not possible to get it in there either.

    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
Reply Children
No Data