[xsl] in for-each apply-templates doesnot work

Subject: [xsl] in for-each apply-templates doesnot work
From: "Jochen Herrmann" <jochen.herrmann@xxxxxxxx>
Date: Tue, 18 Sep 2001 16:20:15 +0200
Hello,
I got an XML with a lot of tags <row attribute1 attribute2 ...>
containing datarecords

Goal is to select the double datarecords.
I identify them if attribute1 and attribute2 are equal

In XSL I tried to process with "for-each",
getting the actual position1,
searching the next matching row,
getting that position2

      <xsl:variable name="pos1">
         <xsl:value-of select="position()"/>
     </xsl:variable>
     
      <xsl:variable name="pos2">
         <xsl:apply-templates
select="following-sibling::row[@attribute1=$value1]"/>
         <xsl:value-of select="position()"/>
     </xsl:variable>

After that I want to compare the positions and react..
BUT the apply-templates doesn´t work.

To make sure my code works,
I tried the same without for-each with matching each <row>
seperatly and it works but
- position results are 2,4,6.. instead of 1,2,3..
- the double row found with apply-templates
is processed too.

So whats going wrong with for-each and apply-templates?

By, jochen

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


Current Thread