XML entities in attribute value not recognized properly in Trados Studio 2009
Thread poster: kirameister
Oct 5, 2010


I'm having the following issues, and was wondering if it's a specification (if not a bug) of Trados Studio 2009 or I was simply doing something wrong..

=== Background ===
- I'm translating XML files with Trados Studio Professional (SP2) - 9.1.1264.0

- In the DTD file, referred by XML files, there is following definition. It means that "&r;" in the XML should be shown as ® when the XML file is transformed into HTML file :
<!ENTITY r "&#x00AE;">

- For the XML File Type in Trados, I defined something like following parsing rule :
=> Rule type : XPath
=> Rule : //img/@alt
=> Translate : Always translatable
=> Tag type : structure

- This should give me the list of the attribute values specified by above XPath expression on the translation table. However...

=== Problems ===

(a) The detection of the attribute values seems to fail sometimes. Instead of the required attribute value, I see the preceding attribute "name".

For example, suppose we have the following element in a XML :

<img foo="foo1" bar="bar1" alt="Product&r;">

What I see on the translation table is "bar=". It's not "Product&r;" nor "bar1". Funny thing is, that it only occurs *occasionally*. I.e., there are also other elements with the same structure (as above) in the same XML file, but Trados seems to be capable of detecting those other attribute values : "Product&r;".

(b) In the element example in (a), &r; should be shown as a markup (with purple color) as in the elements' strings. What I see, however on the LHS of string table is :


If I'd simply copy it to the RHS (translation column) of the table and save it as a XML file after the translation, the XML file result would be something like the following :

<img foo="foo1" bar="bar1" alt="Product&amp;r;">

whereas it should actually show :

<img foo="foo1" bar="bar1" alt="Product&r;">

The output result was the same even if I disabled the parsing rule mentioned in the "Background" section above. I've also tried entity conversion, but it only take effect for those located as element content (not in the attribute value). The only work-around I could find so far was to copy and paste the &r; markup (colored with purple) from other segment, which would result in an error shown in the "Messages" tab.


As I mentioned above, I wasn't sure if I was doing something wrong, or it was Trados itself which was causing the above issue. I'd appreciate it, if someone could give me a tip.

Thank you in advance!
Akira K.


Another (more critical issue).. Oct 5, 2010

Sadly, I seem to have just encountered another (more critical) issue :

(c) When using the above parsing rule, you'd see something like following :

Stylesheet Designer

that should look like the following in the real XML file :
<img alt="Stylesheet Designer" src="path/to/file"/>

When I translate this string into Japanese using the Trados, the result would was :

<img alt="XSLT スタイルシートデザイナー/path/to/file" />

This is, of course, an invalid XML element, hence you'd receive an error when validating the file. The problem might be caused by the multi-byte codes :Japanese. But I actually have no idea...

Is there any way around this issue?


SDL Community  Identity Verified
United Kingdom
Local time: 16:47
Offline help Oct 5, 2010

Hi Akira,

I dropped you a mail offline about this for now so we can investigate this a little. In general parser rules are not the way to tackle this problem. There are two options, the first being to create an ini from the dtd (use Tag Editor to do this) and use this to create your new filetype in Studio, and the second is to use Entity Conversions in the xml filetype in Studio. Both should work, but I think it would be easier to tackle this off forum and then you can report back if we can sort it out... or not.



[Edited at 2010-10-05 15:50 GMT]


It turned out to be a bug in Trados Studio 2009 Oct 6, 2010

After communicating with SDL support team, it turned out to be a bug in the Trados Studio 2009.

As a work-around, suggested by the support, you could create the *.ini file and convert to TTX file first. This way, attribute values should be handled correctly.

Anyhow, thank you very much for the support team's help!

Best regards,
Akira K.


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

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

XML entities in attribute value not recognized properly in Trados Studio 2009

Advanced search

WordFinder Unlimited
For clarity and excellence

WordFinder is the leading dictionary service that gives you the words you want anywhere, anytime. Access 260+ dictionaries from the world's leading dictionary publishers in virtually any device. Find the right word anywhere, anytime - online or offline.

More info »
SDL Trados Studio 2019 Freelance
The leading translation software used by over 250,000 translators.

SDL Trados Studio 2019 has evolved to bring translators a brand new experience. Designed with user experience at its core, Studio 2019 transforms how new users get up and running and helps experienced users make the most of the powerful features.

More info »

  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search