xsl-list
[Top] [All Lists]

RE: [xsl] FW: Xslt that worked for fop0.20.2 no longer works at later versions

2008-04-29 18:38:31
Can you tell me how I can compare the previous 
value in a for-each loop with the current value

If the nodes you are iterating over happen to be siblings, you can use
preceding-sibling::*[1].

In other cases, try

<xsl:variable name="nodes" select="(the node set)"/>
<xsl:for-each select="$nodes">
  <xsl:variable name="p" select="position()"/>
  then refer to $nodes[$p - 1]

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--