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

Newbie question: how to count equal nodes into one result el

Subject: Newbie question: how to count equal nodes into one result element
From: Tarkanyi Ferenc <Ferenc@xxxxxxx>
Date: Mon, 21 Jun 1999 14:31:15 +0200
t rk nyi ferenc
Hello,

I have the following problem:

This is the source tree:
<count_this>
      <tag>apple</tag>
      <tag>apple</tag>
	<tag>apple</tag>
	<tag>banana</tag>
	<tag>banana</tag>
	<tag>cherry</tag>
	<tag>cherry</tag>
	<tag>cherry</tag>
	<tag>cherry</tag>
</count_this>

The result tree should be something like this:
<result>
     <tag><value>apple</value><occurred>3</occurred></tag>
     <tag><value>banana</value><occurred>2</occurred></tag>
     <tag><value>cherry</value><occurred>4</occurred></tag>
</result>

So generally the question is how can I count equal nodes and put the
result into one result node with XSLT?
Any idea would be appreciated.
Thank you.

Ferenc Tárkányi
project manager, R&D
ObjX International
tel: +36 13280090
e-mail: ferenc@xxxxxxx


 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.