This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

in for-each apply-templates doesnot work


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]