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

RE: How to transform flat structure into hierarchical one?

Subject: RE: How to transform flat structure into hierarchical one?
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Wed, 7 Jun 2000 15:26:43 +0100
RE: How to transform flat structure into hierarchical one?
> That is why Michael gave you the obvious key to make it
> fast by remarking:
>   "Alternatively, change the SQL query so it does the 
> grouping for you"
> 
> Here he does not mean group as in "GROUP BY" but simply as putting
> related records next to each other as in "ORDER BY". Don't 
> think in SQL all the time - English is trickier than that.
> 
Yes, I was speaking generically. But you can go further than SQL ordering to
make the transformation easy, for example you can start with a SELECT
DISTINCT and put a list of distinct key values at the start of the XML file:
it's then easy to work through the distinct values and for each one use
key() to find all the actual records with that value.

Another way to tackle this problem is not to generate an XML file at all.
Instead the program that queries the database can offer the data to the XSLT
processor as a stream of SAX events. It's then easy for it to slip in extra
startElement and endElement events when the key value changes.

Mike Kay


 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.