Inline patterns in XML

Hi,

It's likely that this matter has been queried already, but I couldn't find a good match, if so my apologies.

I have the below XML structure, where I want to treat the variables {} as inline tags in Studio (and ideally also newlines \n). 

  <Term Translate="true">
    <Id>Check36VStatus.FailText</Id>
    <String>{0} - {1} - Have you turned on the Rider with the key?</String>
    <Reference>Text shown when a test step fails for product X</Reference>
    <Added>0001-01-01T00:00:00</Added>
  </Term>
  <Term Translate="true">
    <Id>Check36VStatus.SuccessText</Id>
    <String>{0} - {1}</String>
    <Reference>Text shown when the test step is successfully executed for product X</Reference>
    <Added>0001-01-01T00:00:00</Added>
  </Term>
  <Term Translate="true">
    <Id>Check36VStatusTextDescription</Id>
    <String>Turn on the machine by turning the key.\n\nImportant, if this test fails then all other tests will fail as well.</String>
    <Reference>Description of a UI component for product X</Reference>
    <Added>0001-01-01T00:00:00</Added>
  </Term>

 I've tried to use Embedded content with both of the two below settings, but neither causes the brackets to be rendered as tags.

I don't want to use the TM Variable list as I need a stricter enforcement of the rule. Also, I realise that a workaround would be to tag the source text with something like <DNT>{0}</DNT> but I'd prefer not to have to search and replace in the source/final files.

Is the ECP/Inline tags the correct way to address this, and if so what am I doing wrong?

Thanks!

Simon

Parents
  • Have you defined the TXT embedded content processor in your XML file type? If so, did you enter a proper structure information in all relevant tags?
    If yes, try to use {[^}]*} or at least {.*}, but the second one will mask ANYTHING between [ and }, which will result in wrong parsing. Your rule has an error - you used {*.}... You can also test {.+?} - this means { followed by at least one character and stopping when } is found (lazy rule).

    But why don't you simply use XML parser with legacy embedded content and use the same regex, but there?

    _________________________________________________________

    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.

  • Thanks for your reply Jerzy,

    I defined the TXT ecp in the XML file type. {.+?}, and defined the below settings as the rule (also tried with "{[^}]*}" ), but the brackets are still shown as plain text..

    I haven't tried the legacy embedded content processer, is it better? Will give it a shot on Monday morning!

    Wish you a good weekend,
    Simon

  • Hi Paul
    Oh, this was just a screenshot from my own file type, as you may note. And in that very case we have HTML inside of XML with huge problem with entities, which do not get parsed properly. But this is another story, already visited by the support.
    I am still learning here, but thanks to your blogs and help the learning curve is not too steep.
    The screenshot should show, how to switch the ecp on and assign the document structure information.

    In this very case here I would indeed use the legacy one. The xml structure seems to be simple, so using the method you've shown with //* as not translatable and then opening the other tags one by one would be my way here.

    Best regards, Jerzy

    _________________________________________________________

    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.

  • May I join the discussion? I had a very similar problems and using Embedded playing text plus correctly configuring the ECP in the filetype worked well.

    The only thing i couldn't do is this:

    Between my XML segments I have something like this:

    La corretta installazione della macchina.{CR}La conoscenza del funzionamento

    Where {CR} would be the paragraph break character.

    Is there any way I can tell trados to use it as a segment split character (and of course hide it)?



    In the embedded content you can declare, that this {CR} (defined literally) shall be excluded in the segmentation (see Simons screenshots), but from my experience this does not work properly. So I'm afraid I do not know a method to exclude.
    However, if you have embedded html, you can indeed declare <br /> as break in the ecp for html. This works.

    BTW, you will not use all this information in Trados - it is SDL Trados Studio, where it is applicable :=

    _________________________________________________________

    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.

  • Unknown said:

    Between my XML segments I have something like this:

    La corretta installazione della macchina.{CR}La conoscenza del funzionamento

     Where {CR} would be the paragraph break character.

    Is there any way I can tell trados to use it as a segment split character (and of course hide it)?

    Hi Enrico,

    To do this you need to create a segmentation rule on your TM.  I guess the lack of a space after the period is preventing the segmentation normally.

    Regards

    Paul

    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

  • Yep, SDL Trados Studio 2015 the latest, I absolutely apologize for the "friendly short nickname" i used :-) that's the only "trados" for me :-)

    I have several tags composed as [b:my bold sentence] (and many variants of it) i can track with plain text embedded content. If i use embedded html I'd loose the (much loved) grep features of the filter....

    Thank you very much.
  • Paul: I did this, but it leaves the {CR} inside the segment. (and this produces huge amount of fuzzies :-P )

  • Hi Enrico,

    ok - after you managed to split the segments with a segmentation rule and you end up with this:

    La corretta installazione della macchina.{CR}

    La conoscenza del funzionamento

    You just need to make a tag excluded like this:

    Now it should be perfect!

    Regards

    Paul

    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

  • Oh, this is what exclude stands for. And now I understand, why it does NOT segment here.
    Would it be possible to add that so far to the embedded content? Otherwise we will need to create special TMs for such cases...

    _________________________________________________________

    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.

  • Unknown said:
    Oh, this is what exclude stands for. And now I understand, why it does NOT segment here.
    Would it be possible to add that so far to the embedded content? Otherwise we will need to create special TMs for such cases...

    Hi Jerzy,

    I recall asking for this a long time ago and there are technical limitations apparently because of the way the files are converted to sdlxliff.  I think you just need to knock up a set of rules for your TMs when needed, and use them for segmentation only with no read/write capability.  Would be easier if it was possible on the filetype I agree... but it's not :-(

    Paul

    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

  • Dear Paul

    Hi Jerzy,

    I recall asking for this a long time ago and there are technical limitations apparently because of the way the files are converted to sdlxliff. I think you just need to knock up a set of rules for your TMs when needed, and use them for segmentation only with no read/write capability. Would be easier if it was possible on the filetype I agree... but it's not :-(

    Paul


    What about long overdue enhancement for exporting and importing TM settings? Just a click and all settings are exported, then imported as needed. This would be a great improvement - and is overdue sinde Studio 2009 afair :)

    Best regards & have a nice weekend
    Jerzy

    _________________________________________________________

    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.

  • Oh right!, thank you Paul! I'm going to apply it today. This should make it perfect!.
Reply Children
No Data