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

Hello

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 :

Product&amp;r;

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.


Direct link Reply with quote
 

kirameister
TOPIC STARTER
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?


Direct link Reply with quote
 

SDL Community  Identity Verified
United Kingdom
Local time: 01:51
English
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.

Regards

Paul


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


Direct link Reply with quote
 

kirameister
TOPIC STARTER
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.


Direct link Reply with quote
 


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







Déjà Vu X3
Try it, Love it

Find out why Déjà Vu is today the most flexible, customizable and user-friendly tool on the market. See the brand new features in action: *Completely redesigned user interface *Live Preview *Inline spell checking *Inline

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

SDL Trados Studio 2017 helps translators increase translation productivity whilst ensuring quality. Combining translation memory, terminology management and machine translation in one simple and easy-to-use environment.

More info »



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