Conditional translation of HTML attribute in XML file

I would like to localize the href attribute of a tags, but not if they contain a certain string. I can't get the HTML5 Embedded Content Processor to accept two rules for the a tag, they constantly seem to overwrite each other. (I am using the XML2 file type with HTML embedded as PCDATA.)

Trados Studio Project Template Settings window showing a list of parser rules for HTML5 Embedded Content Processor with two rules for 'a' tag highlighted.

This is not about xpath, but about the behavior of the ECP customization. I leave the "a" parser rule untouched as it is and create another rule that I call "a href". I define the condition as "a[href="https://www.example.com/"]. This works, and I can define the text color to be different than the other links. (So the xpath works.)

But the setting for which attributes are translatable seems to be shared between these two parser rules. When I change it in one of the two, the other one changes as well.

Also, When I edit the "a href" rule, the condition is always set to the name, and I have to enter my xpath string again.

Is all that intentional? How can I define attributes conditionally translatable?

Daniel

BTW:

A related xpath related discussion is here:

https://community.sdl.com/product-groups/translationproductivity/f/regex_and_xpath/8205/using-the-html-5-filter-in-studio-2015-i-need-to-extract-an-attribute-for-translation-but-only-if-another-attribute-is-set-to-button-how-do-i-do-this



Generated Image Alt-Text
[edited by: Trados AI at 10:46 PM (GMT 0) on 28 Feb 2024]
emoji