RE: [xsl] Getting Duplicate value while retrieving

Subject: RE: [xsl] Getting Duplicate value while retrieving
From: Jarno.Elovirta@xxxxxxxxx
Date: Tue, 18 Nov 2003 12:55:35 +0200
Hi,

>      <xsl:for-each select="ENTRY[1]/PARA">
>       <xsl:if test="position() &gt; 1">
>        <tr>
>         <td>
>          <xsl:value-of select="."/>
>         </td>
>         <td>
>          <xsl:value-of select="../following-sibling::*[1]"/>

Here you're creating a text node with the string value of the second ENTRY, thus you get the concenation of the PARA values. Rewrite it to e.g.

  <xsl:for-each select="ENTRY[1]/PARA[position() > 1]">
    <xsl:variable name="position" select="position()"/>
    <tr>
      <td>
        <xsl:value-of select="."/>
      </td>
      <td>
        <xsl:value-of select="../following-sibling::ENTRY[1]/PARA[$position + 1]"/>
      </td>
    </tr>
  </xsl:for-each>

Cheers,

Jarno - Viola: Violentia

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread