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

Struggling with tables

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

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:
<IM>
<RECORD_A>
<IMDATA>
<A1>Z</A1>
<A2>ack pthpt</A2>
<A3>424-555-555</A3>
...
<A50>Stevie Franchise</A50>
</IMDATA>
</RECORD_A>
</IM>


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)
etc.

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

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

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.