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

replacing values in file1 from file2

Subject: replacing values in file1 from file2
From: "ronan martin" <ronanmartin124@xxxxxxxxxxx>
Date: Thu, 25 Mar 2004 12:46:21 +0100
replacing values in xslt
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
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.