XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] 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:

<tu>
	<tuv xml:lang="language_1"><seg>contents in language_1</seg></tuv>
	<tuv xml:lang="language_2"><seg>contents in language_2</seg></tuv>
</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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS