Trados Studio 2014 File Types XML Parser settings
Thread poster: MediaEFX

MediaEFX
Local time: 03:44
Feb 14, 2014

Hi,

I have an XML file structured in the following manner.

<?xml version="1.0" encoding="UTF-8" ?>
<illustratortext source="English" target="Japanese">

<file name="C:\Users\Visitor\Desktop\Test\test01.ai">

<story id="1">
<paragraph id="1" font="DFPHSGothicCID-W5" size="12" baselineshift="0">Hello.</paragraph>
</story>

<story id="2">
<paragraph id="1" font="DFPHSGothicCID-W5" size="14" baselineshift="0">It's raining today.</paragraph>
</story>

</file>

<file name="C:\Users\Visitor\Desktop\Test\test02.ai">

. . .

</file>

</illustratortext>


I need to set up a new file type for this XML file, but I can't seem to configure it so that
I would be able to translate the content in <paragraph> elements.
I also need to be able to see the name attribute in <file> elements, so that the translators can see which file they are translating.

Could some one instruct me what I need to do?

parser%20settings.jpg


Thank you!
Tak Osato

[Edited at 2014-02-15 00:22 GMT]

[Edited at 2014-02-15 02:09 GMT]


 

SDL Community  Identity Verified
United Kingdom
Local time: 20:44
English
Maybe the easiest thing... Feb 15, 2014

... and preferable for the translator is to create a stylesheet with your xml filetype. Then you could do something like this:


To do this I used two rules for the xml filetype:

//paragraph (Always Translatable)
//* (Not translatable)

And I created a basic stylesheet like this (saved as *.xsl and added in the Preview node of the filetype):

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:for-each select="illustratortext/file">
<i><font color="#0000FF" size="2"><xsl:value-of select="@name"/></font></i><br/>
<xsl:for-each select="story">
<b><font color="#380000" size="3"><xsl:value-of select="paragraph"/></font></b><br/>
</xsl:for-each>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

The benefit being of course is that the preview is realtime and you don't have to mix up non-translatable information in the Editor View.

Regards

Paul


 

MediaEFX
Local time: 03:44
TOPIC STARTER
Solved! Feb 16, 2014

Hi Paul,

Exactly the solution that I was looking for!

Extremely curious, which part of your code tells it to put the red box around the currently selected segment in the Preview?
Pardon me, I have no experience with working with stylesheets.

Thank you very much!
Tak Osato (Mediaefx Inc.)


 

SDL Community  Identity Verified
United Kingdom
Local time: 20:44
English
Studio adds the red box Feb 16, 2014

So all you do is create the stylesheet and the selected segment in the stylesheet is matched to the active segment in the Editor View.

Regards

Paul


 

MediaEFX
Local time: 03:44
TOPIC STARTER
That's wonderful! Feb 16, 2014

Thanks, Paul. Another overlooked feature of Trados.

Tak


 


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


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

Trados Studio 2014 File Types XML Parser settings

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