[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: powerful command line tool ?

  • From: Jean-Christophe Helary <jean.christophe.helary@gmail.com>
  • To: xml-dev@lists.xml.org
  • Date: Fri, 25 Jun 2010 14:55:05 +0900

Re:  powerful command line tool ?
Thank you Liam for your follow-up.

On 25 juin 10, at 10:45, Liam R E Quin wrote:

>> I am looking for a command line tool that:
>> 1) can easily merge XML files of the same format
> There is no universal clear definition of what it means to
> merge two trees.

Indeed. The tree I am talking about here is simply anything that is found in the <body> of the file.

A TMX file is basically a list of translation unit variant sets like this:

	<tuv xml:lang="language_1"><seg>contents in language_1</seg></tuv>
	<tuv xml:lang="language_2"><seg>contents in language_2</seg></tuv>

So, merging two TMX involves basically getting all the <tu> sets of one file and putting them in the other file. Which can easily be done with any text editor of course.

>> 2) can modify/remove/add attributes or tags easily
>> 3) does all that quickly (including save)
> You could try xmlstarlet, or maybe learn XQuery Update,
> and/or XSLT.

The basic idea for point 2 above is: unify the language codes (change all the "en-us" to "en" for ex), remove/change properties (like various IDs, times etc), remove duplicate <tu> sets by checking only the <seg> contents and taking or not into account the various attributes. Eventually split the file (extract <tu> sets) based on some criteria (a language variant, or a duplicated <seg> contents for ex) etc.

I have tried XSLT in the past (with the introduction given in "Learning XML" from Oreilly along with a few tutorials on the web) and it was far from trivial for my needs at that time (converting a proprietary bilingual XML format into a WordML .doc file for easier reading).

I'll sure check xmlstarlet and XQuery Update.

I'd like to go beyond "Learning XML" at one point though, so I've put "XML Hacks" and "XSLT: Mastering XML Transformations" both from Oreilly in my Amazon cart, but are there better options out there ?

> "I want a tool that makes a potentially very complex problem very simple
> for me without me having to specify what it is exactly or how it works"
> has been the dream of overpaid executives for decades :-)
> However, if you can give us a more precise idea of exactly what you
> want, you might get a more specific answer...

I am starting to suppose that all I describe is within the real of XSLT though...

The idea is not so much something that I could use for myself, but a process that I could simplify enough at one point to share with fellow translators who may not be super computer savvy.

Jean-Christophe Helary
fun: http://mac4translators.blogspot.com
work: http://www.doublet.jp (ja/en > fr)
tweets: http://twitter.com/brandelune

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.