Studio 2009 Parser rules XML
Thread poster: Extra Consult

Extra Consult
Belgium
Local time: 05:25
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


 

SDL Community  Identity Verified
United Kingdom
Local time: 05:25
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


 

SDL Community  Identity Verified
United Kingdom
Local time: 05:25
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


 

Extra Consult
Belgium
Local time: 05:25
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


 


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







CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use SDL Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

More info »
Wordfast Pro
Translation Memory Software for Any Platform

Exclusive discount for ProZ.com users! Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value

More info »



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