xsl-list
[Top] [All Lists]

RE: problem with xsl:if

2002-11-15 06:25:41
<xsl:if test="../codenet = ../following-sibling::agent/codenet">

the problem with position() is that the context inside a predicate is
different from the context outside the predicate.  xx[position()] is
short for xx[position()=position()] which is the same as xx[true()] (or
just xx). xx[position()+1] is short for xx[position()=position()+1]
which is the same as xx[false()].

Michael Kay
Software AG
home: Michael(_dot_)H(_dot_)Kay(_at_)ntlworld(_dot_)com
work: Michael(_dot_)Kay(_at_)softwareag(_dot_)com 

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Yann Verlynde
Sent: 15 November 2002 09:52
To: XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] problem with xsl:if


Hello,

How can I do to compare the 2 values codenet in a xsl:if

I tried: <xsl:if test="../codenet[position()] = 
../codenet[position()+1]"> but it doesn't work

 <agent id="013">
  <datenaissance>27/02/1967</datenaissance>
  <sexe>M</sexe>
  <cadreemploi>emploi3</cadreemploi>
  <codenet>3</codenet>
  <specialite>specialite3</specialite>
  <discipline>discipline3</discipline>
  <datedebut>3/01/1977</datedebut>
 </agent>
 <agent id="014">
  <datenaissance>27/02/1977</datenaissance>
  <sexe>F</sexe>
  <cadreemploi>emploi4</cadreemploi>
  <codenet>4</codenet>
  <specialite>specialite4</specialite>
  <discipline>discipline4</discipline>
  <datedebut>4/01/1977</datedebut>
 </agent>

Thanks in advance


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



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



<Prev in Thread] Current Thread [Next in Thread>