[xsl] Struggling with tables

Subject: [xsl] Struggling with tables
From: "Vic Gar" <vlg8693@xxxxxxxxxxx>
Date: Tue, 15 Oct 2002 09:17:57 -0400

Hello all

I'm an xslt newbie struggling with generating an html table using Saxon 6.5.2, even after trying to imitate the abundant examples at Dave Pawson's amazing site.
I have some unfortunate markup to deal with:
<A2>ack pthpt</A2>
<A50>Stevie Franchise</A50>

I'm trying for 3 tables, each with 4 columns, like so:
Table 1
A1  (A1 data here)   A2 (A2 data here)
A3  (A3 data here)   A4 (A4 data here)

for A1-A9, then the next table A10-A23, then the last table A24-A50. The 3 different tables give me a chance to separate & label them (very different things, although they are for some reason grouped together) and format them differently.

The examples make clear that the formula is to make rows by using the mod function, and then output <tr> as a literal result element. "Inside" the <tr></tr>, one then applies templates to the node itself and it's following siblings that satisfy the position criteria.

<xsl:for-each select="item[position() mod 5 = 1]">
    select=".|following-sibling::item[position() < 5]"/>

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]"/>

Thanks for any insights

_________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com

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

Current Thread