xsl-list
[Top] [All Lists]

RE: replacing values in file1 from file2

2004-03-29 01:19:36
Hi,

  <xsl:variable name="position" 
select="count(preceding-sibling::self)"/>

There is no element "self" in file1.

  <xsl:for-each select=".">

You're already processing the current node, thus this is not needed. Try 
something like this

  <xsl:template match="tuv[lang('da-dk')]/seg[not(ph)]/text()">
    <xsl:variable name="position" 
select="count(../../../preceding-sibling::tu[tuv[lang('da-dk')]/seg[not(ph)]])"/>
    <xsl:text>"</xsl:text>
    <xsl:value-of select="document('file2.xml', 
/)/values/value[count(preceding-sibling::value) = $position]"/>
    <xsl:text>"</xsl:text>
  </xsl:template>
  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>

Cheers,

Jarno - Suicide Commando: Deliver Us From Evil
<Prev in Thread] Current Thread [Next in Thread>