Two Laptop Bag*
The moose likes XML and Related Technologies and the fly likes Counting nodes using xsl:key Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Counting nodes using xsl:key" Watch "Counting nodes using xsl:key" New topic
Author

Counting nodes using xsl:key

V Chauhan
Ranch Hand

Joined: Nov 15, 2002
Posts: 70
Hi Ranchers,

I have the following xml data.


I need to generate the count of teachers and doctors for each state i.e., the output xml should look like the following.



I wrote a xslt file to group the number of nodes based on location.



However I am not able to add another level of grouping to this xslt to group nodes based on profession (in addition to location). Something like using two group by clauses in a sql query. Any ideas or suggestions?

Thanks in advance,
Basu
Clifton Craig
Ranch Hand

Joined: May 26, 2006
Posts: 103
Have you tried something like this? (completely off my head and untested and not garunteed...)


That's just a guess at something you could try.
(All code samples are provided as is and should be used as directed. Do not use if you are pregnant or expect to become pregnant. Certain usage may run the risk of baldness and/or blindness. Consult your tech manual if you experience pain or swelling as this may a symptom of a serious related illness.)


Holla at me...<br /><a href="http://codeforfun.wordpress.com" target="_blank" rel="nofollow">http://codeforfun.wordpress.com</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Counting nodes using xsl:key
 
Similar Threads
XSL 2.0 (looking for ideas)
following::* doubt
date range in xsl
node() test condition
mock question