This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: compare two values
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] compare two values
- From: "Jan Weiss" <jweiss at bct-technology dot com>
- Date: Tue, 7 Aug 2001 15:52:13 +0200
- Reply-To: xsl-list at lists dot mulberrytech dot com
thanks oleg
works perfect!!
jan
-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Oleg
Tkachenko
Sent: Dienstag, 7. August 2001 15:56
To: xsl-list@lists.mulberrytech.com
Subject: RE: [xsl] compare two values
Hello Jan !
> i want to compare the value of <Art_nr> in one row with this, which is in
> the row before. if they are similar, i want to show something, if not
> nothing should happen.
> how can i coompare these values. i tried to do it by count(row) and the
> position() function but it does not work.
You can get access to previous row in the current nodeset by
"preceding-sibling::row[1]" expression and compare rows' values by simple
'=' operator.
<xsl:apply-templates select="row">
...
<xsl:template match="row">
<xsl:if test="preceding-sibling::row[1]/Art_nr = Art_nr">
do something
</xsl:if>
Row processing
</xsl:template>
---
Oleg Tkachenko
Multiconn International
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list