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

Re: Extracting the grouping from a flat structure

Subject: Re: Extracting the grouping from a flat structure
From: Peter Wyngaard <peter@xxxxxxxxxxxx>
Date: Mon, 6 Dec 2004 17:52:00 -0500
peter wyngaard
Hi Kev --

Thanks for your reply. Could you post sample code for your two-pass idea? I'm really new at XSL and I don't think I follow your idea.

Thanks,

Peter

On Dec 6, 2004, at 8:47 AM, Kevin Jones wrote:

On Monday 06 December 2004 00:34, Peter Wyngaard wrote:

<xsl:for-each select='//TABLE[@class="results"]/TR[TH]'> <header> <xsl:attribute name=...>...</xsl:attribute> <xsl:variable name='thisHeader' select='generate-id(.)'/> <xsl:for-each select='following-sibling::TR[$thisHeader=generate-id(pre ceding- sibling::TR[TH][1])]'> <row> ... </row> </xsl:for-each> </header> </xsl:for-each>

Hi Peter,


This looks to me like a pretty standard solution to this
problem although its clearly inefficient for larger data
sets.

As an alternative I would be tempted to try a two pass
approach, the first to collect the position() of all your
headers in a variable and the second to chop and process a
nodeset of all the rows using a recursive template and the
position() data. This would exchange searching for nodeset
manipulation so your milage will vary on different
processors.

Kev.

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.