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

Re: Struggling with tables

Subject: Re: Struggling with tables
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 15 Oct 2002 14:47:09 +0100
Re:  Struggling with tables
Hi Vic,

> <xsl:for-each select="item[position() mod 5 = 1]">
> <tr>
>   <xsl:apply-templates
>      select=".|following-sibling::item[position() < 5]"/>
> </tr>
> <xsl:for-each>
>
> My problem is the xml I've been given. The elements at this level
> all have different names, so how can I rephrase the above loop to
> work with this xml? Something like <xsl:apply-templates
> select=".|following-sibling::A1 or A2 or A3 or A4 (etc)[position() <
> 5]"/>

You *could* specify each of the names as follows:

  . | following-sibling::*[self::A1 or self::A2 or self::A3 ...]
        [position() < 5]

but probably you don't need to test the names at all; just use:

  . | following-sibling::*[position() < 5]

(Note that you have to escape the < to &lt; when you use this
expression within the XSLT.)

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.