[xsl] replacing values in file1 from file2

Subject: [xsl] replacing values in file1 from file2
From: "ronan martin" <ronanmartin124@xxxxxxxxxxx>
Date: Thu, 25 Mar 2004 12:46:21 +0100
Hi

I've been stuck on this - I thought it would be simpler than it is. (I'm pretty much only just past beginner level)
I have two xml files. One with pairs of terms in source and target language but with an untranslated target language term (say, English and Danish). In another xml file I have the Danish translations, one for each pair of terms, and sequenced in exactly the same way.


<file1>
 <terms>
   <source lang="english">
     <term>dog</term>
   </source>
   <source lang="danish">
     <term>dog</term>
   </source>
 </terms>
 <terms>
   <source lang="english">
     <term>dog</term>
   </source>
   <source lang="danish">
     <term>dog</term>
   </source>
 </terms>
</file1>

<file2>
 <tranlated>
   <term lang="danish">hund</term>
   <term lang="danish">bord</term>
 </translated>
</file2>

I've tried matching a nodeset in file1 using <.. match="//source[@lang='danish']/term"> seems fine. Then I've tried to copy-of the value from select="document('file2.xml')//term/text()" in various ways. I get the first value only from the list copied, but in all the locations I wanted. How do I pass on the number of the node in the first nodeset to the nodeset selected from the second file. I tried setting up a variable using position() but couldn't get it to work.
Sorry this is so long-winded. I simplified the xml. In reality I'm using tmx which is a translation memory format.


thanks
Ronan

_________________________________________________________________
Fe alle de nye og sjove ikoner med MSN Messenger http://messenger.msn.dk

Current Thread