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

Re: dynamic grouping of tabular data; one or two trans

Subject: Re: dynamic grouping of tabular data; one or two transformations?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Sat, 24 Nov 2001 15:20:06 +0000
xml and dynamic grouping
Hi Dan,

> So here is my question to the list: Is it possible to do this with
> *one* stylesheet transformation? I can't see a way to generate the
> required grouping keys dynamically. My thinking is to first generate
> a stylesheet with the required key definitions and essential
> transformation code and then transform the original XML source with
> this generated stylesheet:
>
>   xsl2 = xml.transformNode(xsl1);
>   html = xml.tranformNode(xsl2);
  
It *is* possible to do it with a single transformation. If you know
what the fields are (i.e. A, B, C and D) in advance, you can set up
the keys for grouping by each individual field and then use predicates
to ensure that the groupings are working in the correct manner, rather
than having keys for each combination. If you don't know the fields in
advance it's more complicated, although even then if you can use
intermediate node sets (i.e. use a node-set() extension function) to
build the groups up step-by-step then it's doable.

But I think that using a two-step transformation where the first
transformation generates the keys that you use for the second
transformation is probably more straight-forward in the long run.

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.