Cannot get content between square brackets in XML file to be processed as embedded content

Hello folks,

I have an XML file in which there is content between square brackets, which I don't want to appear in the editor (or at least be converted to tags).

Here's what the XML looks like:

<?xml version="1.0" encoding="UTF-8"?>
<nodes>
<node name="XXXX1">
    <entry key="description">
[table id=34096]
    [row id=34345054]
        [cell id=3458659][b]lorem ipsum[/b][/cell]
        [cell id=4564567][b]lorem ipsum 2[/b][/cell]
        [cell id=3458936][b]Lorem ipsum 3[/b][/cell]
    [/row]
[/table]
</entry>
  </node>
  </nodes>

This is my first time trying this out so I tried to follow Paul's procedure from this topic but to no avail so far. Here's what I did:

- Create a new embedded file type processor by copying the Plain Text embedded content file, and adding the opening and ending regexp rules for the brackets:

Trados Studio screenshot showing the embedded content file type settings with a focus on SQUARE BRACKETS CONTENT and regular expression rules for brackets.

- Create a new XML file type and selecting this new content processor:

Trados Studio preview window displaying XML content with square brackets, indicating that the regular expression rules may not be applied correctly.

The preview on the XML file shows that I've not quite done things right, any idea as to what?

Thanks a lot,

Romain



Generated Image Alt-Text
[edited by: RWS Community AI at 10:49 AM (GMT 0) on 14 Nov 2024]
emoji
Parents
  • Hi 

    From your screen prints I think you are exploring features of XML settings that wont give you want you need - for example your example has nothing to do with CDATA

    What  provided was perfect. Now its just a case of implementing it correctly.

    Please find attached my sample file + file type settings (that you can import and use) which I should give you what you are looking for  

    The key area of note is that I added context to //entry
    Trados Studio parser settings showing rules for XML tags with context set to 'Cell'.

    This context was where I added embedded content and defined the regular expression given by the super helpful  and reviewed your segment rules

    Trados Studio embedded content settings with a regular expression rule highlighted and a segmentation hint set to 'Exclude'.

    At embedded content level you then have segmentation rules (Option A/B) that help decide if the content should be excluded or included with the tag

    Option A

    Preview of XML content in Trados Studio with tags like 'b' and 'cell' visible around text 'lorem ipsum'.

    Option B (optimal from my perspective) 
    Final preview in Trados Studio showing clean segmentation of text 'lorem ipsum' without XML tags.

    <?xml version="1.0" encoding="UTF-8"?>
    <nodes>
    <node name="XXXX1">
        <entry key="description">
    [table id=34096]
        [row id=34345054]
            [cell id=3458659][b]lorem ipsum[/b][/cell]
            [cell id=4564567][b]lorem ipsum 2[/b][/cell]
            [cell id=3458936][b]Lorem ipsum 3[/b][/cell]
        [/row]
    [/table]
    </entry>
      </node>
      </nodes>
    Community Sample.sdlftsettings

    Have a good day

    Lyds

    Lydia Simplicio | 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 7:36 AM (GMT 0) on 29 Feb 2024]
Reply
  • Hi 

    From your screen prints I think you are exploring features of XML settings that wont give you want you need - for example your example has nothing to do with CDATA

    What  provided was perfect. Now its just a case of implementing it correctly.

    Please find attached my sample file + file type settings (that you can import and use) which I should give you what you are looking for  

    The key area of note is that I added context to //entry
    Trados Studio parser settings showing rules for XML tags with context set to 'Cell'.

    This context was where I added embedded content and defined the regular expression given by the super helpful  and reviewed your segment rules

    Trados Studio embedded content settings with a regular expression rule highlighted and a segmentation hint set to 'Exclude'.

    At embedded content level you then have segmentation rules (Option A/B) that help decide if the content should be excluded or included with the tag

    Option A

    Preview of XML content in Trados Studio with tags like 'b' and 'cell' visible around text 'lorem ipsum'.

    Option B (optimal from my perspective) 
    Final preview in Trados Studio showing clean segmentation of text 'lorem ipsum' without XML tags.

    <?xml version="1.0" encoding="UTF-8"?>
    <nodes>
    <node name="XXXX1">
        <entry key="description">
    [table id=34096]
        [row id=34345054]
            [cell id=3458659][b]lorem ipsum[/b][/cell]
            [cell id=4564567][b]lorem ipsum 2[/b][/cell]
            [cell id=3458936][b]Lorem ipsum 3[/b][/cell]
        [/row]
    [/table]
    </entry>
      </node>
      </nodes>
    Community Sample.sdlftsettings

    Have a good day

    Lyds

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