Technical Questions Regarding CDATA Embedded Content in Trados Studio 2009
Thread poster: lthurston
Jan 15, 2013

I have a couple of quick technical questions regarding the CDATA Embedded Content processing in Trados 2009. I'm new to Trados, but am good with regular expressions and understand HTML / XML quite well.

First of all, are backreferences possible in the Tag Definition Rules, specifically from the end tag to the start tag? This is a somewhat minor point, but the start and end tags don't seem to reliably be associated with the other. If there is a backreference syntax, what is it? It other words, without making a rule for each tag, could I refer to a captured group from the start tag in order to match the appropriate end tag, like this (ignore that there's no slash at the beginning of the end tag, I'm having some issues with this forum's content processing):

Start tag: <([a-z][a-z0-9]*)[^<>/]*>
End tag: </\1[^<>]*>

Of course that doesn't work or I wouldn't be asking.icon_smile.gif Trados' feedback when I enter that indicates backreference seem like it would work, but would only refer to a captured string in the end tag. I want the capture in the start tag.

The more important question has to do with HTML attributes in CDATA Embedded Content, and whether anyone is aware of a way to make attributes editable. Ideally, the goal would be to make a very small subset of all attributes editable (src, href, title, etc) for all tags. I might be able to do this by modifying the regex for the start and end tag so that it doesn't include anything past the tag name, but that feels hacky and wrong.

If this isn't possible with the CDATA Embedded Content, is there another way to come at this problem? Another Embedded Content option? I guess what I'm getting at is: is this possible with Trados at all?

Thanks for you help!



SDL Community  Identity Verified
United Kingdom
Local time: 20:26
Back references in here Jan 16, 2013


I think back references will only work here in the same field, so capturing in either the start and referencing in the end will not work. What you would have to do is this (as you probably already know):



The current solution here is not hugely comprehensive and you would have to go the "hacky" route to try and take translatable content from attributes within an embedded content section. There will be an improved solution for this in a future build but for now you'd have to use regex.




. Jan 16, 2013

Thanks, Paul.

Understood regarding the start / end tag matching.

As far as the editable attributes are concerned, do you have any idea of when the "improved solution" will be released? It's an improvement to the CDATA embedded content component, is that right? Do you have any specifics on what / how it will allow attributes to be marked as translatable or not translatable?

And there's no other way to go about this currently?



Local time: 11:26
You have to get super-specific Jan 16, 2013

As Paul notes, any backreferences in an end tag expression only apply to that end tag expression -- they cannot refer to anything in the start tag expression.

Consequently, to get closing tags to match up properly with their starting tags, you need to get super-specific in your tag definition rules. For some XML file types that we deal with, which also include CDATA sections, I've just defined all of the specific tags that show up in those CDATA sections. Tedious, but effective.

Defining attributes to translate gets uglier. I haven't tested this, but something like the following might work, with one start/end def for the element with the attributes to translate, and one start/end def for the element without the attributes to translate. It's hacky, and probably won't work if the element has more than one attribute.

<p (src|href|title|etc)="






-- Erik Anderson


Thanks Jan 22, 2013

I appreciate the additional information, and the alternate start / end tag configuration to get translatable attributes. I'll definitely set up tag-specific rules, but will try to see if I can hold off on the translatable attributes until it's supported by the software.

Paul, I'd still be interested if you have any timeline on the features we're discussing.



To report site rules violations or get help, contact a site moderator:

You can also contact site staff by submitting a support request »

Technical Questions Regarding CDATA Embedded Content in Trados Studio 2009

Advanced search

BaccS – Business Accounting Software
Modern desktop project management for freelance translators

BaccS makes it easy for translators to manage their projects, schedule tasks, create invoices, and view highly customizable reports. User-friendly, integration, community-driven development – a few reasons BaccS is trusted by translators!

More info »
Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »

  • All of
  • Term search
  • Jobs
  • Forums
  • Multiple search