|
[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
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








