[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

in for-each apply-templates doesnot work

Subject: in for-each apply-templates doesnot work
From: "Jochen Herrmann" <jochen.herrmann@xxxxxxxx>
Date: Tue, 18 Sep 2001 16:20:15 +0200
for each apply templates
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.