Studio 2009 Parser rules XML
Thread poster: Extra Consult

Extra Consult
Belgium
Local time: 03:36
Member (2008)
English
Aug 20, 2012

Hi all,

I'm having a bit of a problem with an XML we've received for translation. Normally, I can create the parser rules for XML myself, but I don't know if Studio can handle the following mark-up.

The text to be translated is withing a single tag, looking like this:
Code:

%tab text1="tobetranslated1" text2="tobetranslated2" text3="tobetranslated3" text4="tobetranslated4" button="tobetranslated5" link="http://www.somelink"/%


I can define content if it is in between tags, opening and closing, but not if the text is within the tag;
So I can define %tab% translate this bit of text %/tab% but not the above.

Furthermore, I would need to protect the text1, text2 etc entries, as the shouldn't be translated.

Is creating a rule like this at all possible?

** I used % instead of > as I can't seem to figure out how to post XML codeblocks on the forum **

Kind regards,
Geert


Direct link Reply with quote
 

SDL Community  Identity Verified
United Kingdom
Local time: 03:36
English
Maybe use the regex filetype instead? Aug 20, 2012

Hi,

There is a blog article here on using the regex filetype ( http://wp.me/p2xDjK-1d ), and rather than extract the text between the quotes perhaps you can try using placeholders to turn the non-translatable into tags instead:


So not exactly what you wanted but perhaps this would work?

Regards

Paul


Direct link Reply with quote
 

SDL Community  Identity Verified
United Kingdom
Local time: 03:36
English
Apologies... should read your post properly Aug 21, 2012

Hi,

I didn't notice the bit about using % instead of < and >

So in this case you create your xml filetype as normal and use this syntax as xpath expressions for the parser rule:

//tab/@button
//tab/@text1
//tab/@text2
etc...

This gives me this which is probably more like what you're after:


You could also try just this:

//tab/@*

This extracts all the attribute values for translation and based on your example this may also be suitable... have a play and I think you'll find a way to get what you want.

Regards

Paul


Direct link Reply with quote
 

Extra Consult
Belgium
Local time: 03:36
Member (2008)
English
TOPIC STARTER
worked like a charm Aug 21, 2012

Hi Paul,

thanks for the quick resolution. Changing the Xpath expression did the trick. And I'm sure that this will also help me to create solutions for future problems with XML files, so many thanks!

Kind regards,
Geert


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 »

Studio 2009 Parser rules XML

Advanced search







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 »
Protemos translation business management system
Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!

The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.

More info »



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