|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: replacing values in file1 from file2
Jarno - thanks for the suggestion.
I've worked away at it, but I'm still running into the same problem. Could be the variable is going out of scope in some way. Here is the actual xml that I'm working with (minus some attributes and irrelavant children). First File1, then File2, and then the template I'm trying to use. There are two terms, Monday and Tuesday, which are to be translated. My limitation is that I can't change the structure or add elements as this has to be fed back into an application. thanks Ronan File1
<tmx version="1.4">
<body>
<tu>
<tuv xml:lang="en-us">
<seg>
<ph x="1">key1=</ph>
</seg>
</tuv>
<tuv xml:lang="da-dk">
<seg>
<ph x="2">key1=</ph>
</seg>
</tuv>
</tu>
<tu>
<tuv xml:lang="en-us">
<seg>"monday"</seg>
</tuv>
<tuv xml:lang="da-dk">
<seg>"monday"</seg>
</tuv>
</tu>
<tu>
<tuv xml:lang="en-us">
<seg>
<ph x="1">key1=</ph>
</seg>
</tuv>
<tuv xml:lang="da-dk">
<seg>
<ph x="2">key1=</ph>
</seg>
</tuv>
</tu>
<tu>
<tuv xml:lang="en-us">
<seg>"tuesday"</seg>
</tuv>
<tuv xml:lang="da-dk">
<seg>"tuesday"</seg>
</tuv>
</tu>
</body>
</tmx>File2 <values> <value>mandag</value> <value>tirsdag</value> </values> Transate.xsl <xsl:template match="tuv[@xml:lang='da-dk']/seg[not(child::ph)]/text()"> <xsl:variable name="position" select="count(preceding-sibling::self)"/> <xsl:for-each select="."> <xsl:value-of select="document('File2.xml')//value[count(preceding-sibling::value) = $position]"/> </xsl:for-each> </xsl:template> From: <Jarno.Elovirta@xxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: RE: replacing values in file1 from file2 Date: Thu, 25 Mar 2004 14:24:39 +0200
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








