This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: how to seperate sequence?
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: "Thomas Sandor" <tsandor at rndsoft dot com>
- Cc: xsl-list at lists dot mulberrytech dot com
- Date: Mon, 12 Aug 2002 10:35:05 +0100
- Subject: Re: [xsl] how to seperate sequence?
- Organization: Jeni Tennison Consulting Ltd
- References: <000901c241e2$3d203350$1c01010a@tomaxp>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Thomas,
> How can I use e.g. a 'xsl:if test = "position() mod 2 == 0"'
> expression, or does anyone have a better way to do it?
That's almost it. You need to create a row for every odd para in your
content (the ones whose position() mod 2 is 1):
<xsl:for-each select="para[position() mod 2 = 1]">
<tr>
...
</tr>
</xsl:for-each>
Inside the row, the first cell holds the odd para element that you're
looking at, and the second cell holds that para element's immediately
following sibling:
<xsl:for-each select="para[position() mod 2 = 1]">
<tr>
<td><xsl:value-of select="." /></td>
<td><xsl:value-of select="following-sibling::para[1]" /></td>
</tr>
</xsl:for-each>
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list