Parser rules
Thread poster: insignificance

insignificance
Finland
Local time: 04:00
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: 03:00
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: 04:00
TOPIC STARTER
Thanks! Nov 10, 2015

Thank you, that's a great article!

 

insignificance
Finland
Local time: 04:00
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: 03:00
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: 04:00
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: 03:00
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: 04:00
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







TM-Town
Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »
BaccS – Business Accounting Software
Modern desktop project management for freelance translators

BaccS makes it easy for translators to manage their projects, schedule tasks, create invoices, and view highly customizable reports. User-friendly, ProZ.com integration, community-driven development – a few reasons BaccS is trusted by translators!

More info »



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