Parsing HTML tags in custom XML file

After reading the posts that Paul suggested and after reading the existing tickets about this issue, I am not getting this to work.

I defined a custom XML file type and it is parsing the translatable content. But there are HTML tags which are inline and I need to get Studio to mark these as tags and not text. I tried this and it does not help.

Trados Studio screenshot showing the Embedded Content settings with 'Process embedded content' checked and parser rules defined for HTML content.

I tried other things that were suggested here https://multifarious.filkin.com/2020/09/20/psst-wanna-know-a-few-more-things-about-file-types/ and in other posts.

This is what the result looks like.

Screenshot of XML code with HTML tags visible within the translatable content in Trados Studio, indicating a potential issue with tag recognition.

I would appreciate some help to getting this to work. Thank you.



Generated Image Alt-Text
[edited by: Trados AI at 1:00 AM (GMT 0) on 29 Feb 2024]
emoji
Parents
  • Oh, this seems to be a nice Wordpress... The tags are not tags, but are entered in square brackets, so you will have to define the parser rules for these all manually.

    _________________________________________________________

    When asking for help here, please be as accurate as possible. Please always remember to give the exact version of product used and all possible error messages received. The better you describe your problem, the better help you will get.

    Want to learn more about Trados Studio? Visit the Community Hub. Have a good idea to make Trados Studio better? Publish it here.

  • I would create a file type using the old xml process with embedded content and try to add all the tags with regex one by one manually.

    Unfortunately, you need to use regex for this, so if you have no experience with that, it will be next to impossible to create such a file type on your own. The better way would be to ask someone to do that for you. I am sorry, but having to describe that here in forum would require me to write an essay of several pages, and I have no time to do so.

    _________________________________________________________

    When asking for help here, please be as accurate as possible. Please always remember to give the exact version of product used and all possible error messages received. The better you describe your problem, the better help you will get.

    Want to learn more about Trados Studio? Visit the Community Hub. Have a good idea to make Trados Studio better? Publish it here.

  • You can solve this using the fietype you created so far without too much of a problem.  I had a quick play and get this with a few rules:

    Screenshot of Trados Studio showing comparison of two text files with highlighted differences.

    Go to your Embedded Content Processors and copy the "Plain Text" filetype.  I copied at and saved as a new filetype called "DG_content":

    Trados Studio options window with a red arrow pointing to the 'Export' button for the 'DG_content' filetype.

    Then go back to your custom XML filetype... you may need to close the settings window and then open again to ensure you see the new DG_content in your options.  Just select the new DG_content processor:

    Trados Studio 'Embedded Content' settings window with a red arrow pointing to the 'DG_content' processor selected from a dropdown menu.

    Now all you need to do is create your rules in the DG_content embedded content processor.  So go back to it and add whatever rules you need.  I added these all as inline tags:

    Trados Studio 'Inline Tags' settings window displaying a list of rules for the 'DG_content' embedded content processor.

    I put a copy here so you can import them and try them out:

    DG_content.zip

    That should give you an idea and you can extend this to suit whatever you need for the full file you have.  I just used a bit of your file to do this.  To import:

    Trados Studio 'File Types' window with a yellow speech bubble indicating the import option for 'DG_content.zip'.

    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 1:00 AM (GMT 0) on 29 Feb 2024]
Reply
  • You can solve this using the fietype you created so far without too much of a problem.  I had a quick play and get this with a few rules:

    Screenshot of Trados Studio showing comparison of two text files with highlighted differences.

    Go to your Embedded Content Processors and copy the "Plain Text" filetype.  I copied at and saved as a new filetype called "DG_content":

    Trados Studio options window with a red arrow pointing to the 'Export' button for the 'DG_content' filetype.

    Then go back to your custom XML filetype... you may need to close the settings window and then open again to ensure you see the new DG_content in your options.  Just select the new DG_content processor:

    Trados Studio 'Embedded Content' settings window with a red arrow pointing to the 'DG_content' processor selected from a dropdown menu.

    Now all you need to do is create your rules in the DG_content embedded content processor.  So go back to it and add whatever rules you need.  I added these all as inline tags:

    Trados Studio 'Inline Tags' settings window displaying a list of rules for the 'DG_content' embedded content processor.

    I put a copy here so you can import them and try them out:

    DG_content.zip

    That should give you an idea and you can extend this to suit whatever you need for the full file you have.  I just used a bit of your file to do this.  To import:

    Trados Studio 'File Types' window with a yellow speech bubble indicating the import option for 'DG_content.zip'.

    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 1:00 AM (GMT 0) on 29 Feb 2024]
Children