Parser rules
Thread poster: insignificance

insignificance
Finland
Local time: 06:26
Nov 6, 2015

Hi,

Trados studio 2014 user here.

My XMLs have a ton of varying elements, but I only want to translate the same few things in all of them.

Is there a way to create a parser rule that would simply indicate "//everything=not translatable - unless there is a specific rule which makes it 'always translatable'"?

Thanks.


 

SDL Community  Identity Verified
United Kingdom
Local time: 05:26
English
Of course... Nov 6, 2015

... if the element name is everything then you just wrote it!!

\\everything set as non-translatable

If you want a rule to not translate anything until you tell it then use:

\\* set as non-translatable

This article might be useful for you:

http://multifarious.filkin.com/2014/06/01/custom-xml/

Regards

Paul
SDL Community Support


 

insignificance
Finland
Local time: 06:26
TOPIC STARTER
Thanks! Nov 10, 2015

Thank you, that's a great article!

 

insignificance
Finland
Local time: 06:26
TOPIC STARTER
namespace Nov 10, 2015

...and I would have one more question (bear with me).

The texts now look OK in Trados, with the exception of lists, which are not showing up at all. I've tracked down the problem to the namespace tag. I found this, it looks a bit similar. http://www.proz.com/forum/sdl_trados_support/271400-xml_namespace_segmentation.html

When the code is as [div xmlns="http://www.w3.org/1999/xhtml"], the text isn't showing in Trados, but when I erase the xmlns part -> [div], the text shows up normally. What could be the problem? Thanks again!


 

SDL Community  Identity Verified
United Kingdom
Local time: 05:26
English
It's because of the namespace... Nov 10, 2015

... but you could use XPath and and expression to ignore all namespaces. So continuing our example of the "everything" element you could use this:

//*[local-name()='everything']

That will extract all the contents of the "everything" element irrespective of whather a namespace is used or not.

Regards

Paul
SDL Community Support


 

insignificance
Finland
Local time: 06:26
TOPIC STARTER
still astray Nov 11, 2015

Thank you again for your fast and friendly answers, I really appreciate it!


I see this has been solved over and over, but I can't seem to make it work and I feel a bit computer illiterate at the moment...

One more try; if the tag line looks like this (the ns is always the same), how should I formulate that XPath expression to ignore the ns and get 'bullet list item' to show up in Trados?

[textsection][level1][XHTML][ul style="MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px" type="disc" xmlns="http://www.w3.org"]
[li][font style="FONT-SIZE: small" face="Arial"]bullet list item[/font][/li][/ul][/XHTML][/level1][/textsection]


 

SDL Community  Identity Verified
United Kingdom
Local time: 05:26
English
Maybe try this... Nov 11, 2015

... which will work based on your example. Maybe tricky without seeing all your file but it worked for me:

//*[local-name()='font']

Maybe this article will be useful for you as I gave a presentation at the ATA last week on XPath and showed an example similar to this:

http://multifarious.filkin.com/2015/11/07/x-files-ata56/

I like your question though because someone asked me whether these sort of things really happen and do we need things like XPath.

Regards

Paul
SDL Community Support


 

insignificance
Finland
Local time: 06:26
TOPIC STARTER
Great... Nov 11, 2015

Yes, that does indeed work! Thank you for your time and help! That was also about the last thing that I had not yet tried...

 


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


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

Parser rules

Advanced search







memoQ translator pro
Kilgray's memoQ is the world's fastest developing integrated localization & translation environment rendering you more productive and efficient.

With our advanced file filters, unlimited language and advanced file support, memoQ translator pro has been designed for translators and reviewers who work on their own, with other translators or in team-based translation projects.

More info »
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 »



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