Subject: Re: [xsl] Table of contents for all groups at the beginning of each group From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Mon, 19 Nov 2007 14:50:30 -0500 |
I've looked at a lot of examples but I still can't seem to figure out how to do this. I am using XSLT 2.0. I am transforming XML to XHTML.
The XML is something like this:
<corporation> <company> <employee> <department>a</department> </employee> <employee> <department>a</department> </employee> <employee> <department>a</department> </employee> </company> <company> <employee> <department>a</department> </employee> <employee> <department>a</department> </employee> <employee> <department>b</department> </employee> <employee> <department>c</department> </employee> </company> </corporation>
I need to group employees within a company (selected with a param) by department. No problem. What I also need to do is include a table of contents at the beginning of each department grouping linking to each of the other department groups. If there is only one department in the company, I do not display a table of contents.
<xsl:for-each-group select="//company" group-by="department/text()"> <xsl:sort select="department/text()"/>
<br/> <p><a id="<xsl:value-of select='current-grouping-key()'/>"></a></p>
I think my problem is that I don't thoroughly understand how the XML doc is processed so that I can get the group names at the beginning of the the for-each-group.
-- Comprehensive in-depth XSLT2/XSL-FO1.1 classes: Austin TX,Jan-2008 World-wide corporate, govt. & user group XML, XSL and UBL training RSS feeds: publicly-available developer resources and training G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Table of contents for all gro, vwiswell | Thread | Re: [xsl] Table of contents for all, vwiswell |
Re: [xsl] Template matching precedi, Wendell Piez | Date | Re: [xsl] Header Text Overflows Bod, Horace Burke |
Month |