• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Group By Question

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

I've read this article http://www.jenitennison.com/xslt/grouping/muenchian.xml about the Muenchian Grouping method. However, I'm having a little problem while using the described method. I have an xml file, see below (sorry for the amount of XML!), and an XSLT file (which can be provided if you are interest, but the most important part is typed below) I'd like to use the XML to group by the 'Group' element, but I cannot use the new XSLT 2.0 for grouping.
Using the XML below, I'd like to create 3 different (unique) groups. However, while using this XSL:


<xsl:key name="acts-by-group" match="Act" use="Sample/Analysis/Group" />
<xsl:template match="Result">
<xsl:for-each select="Act[count(. | key('acts-by-group', Sample/Analysis/Group)[1]) = 1]">
<xsl:sort select="Sample/Analysis/Group" />


My sorting only works on the first Group in the nested Analysis. I'd like to have it to work on all of them (Group A, Group B (twice) and Group C, creating three unique groups). The resulting HTML should look something like the HTML below.

Any help would be greatly appreciated, cause it's really giving me a headache!!

Thank!

Erik Pragt

-=-=-=-=-=-=-
XML
-=-=-=-=-=-=-



-=-=-=-=-=-=-=
HTML
-=-=-=-=-=-=-=-



(PS, I crossposted this question here and on http://p2p.wrox.com, since this is quite important to me. If an answer will be provided somehow, I will post it on both fora.)
[ August 09, 2005: Message edited by: Erik Pragt ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic