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

Re: how to seperate sequence?

Subject: Re: how to seperate sequence?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 12 Aug 2002 10:35:05 +0100
how to seperate
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


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-2013 All Rights Reserved.