View Single Post
  #1 (permalink)  
Old January 27th, 2005, 10:19 AM
alexshiell alexshiell is offline
Authorized User
 
Join Date: Oct 2004
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default count distinct nodes

In the XML below:

<stuff>
   <something type="12345"/>
   <something type="12345"/>
   <something type="23451"/>
   <something type="23451"/>
   <something type="33333"/>
</stuff>

I want to count the number of distinct types of 'something', in this case its 3.

I've tried using a key, but that only allows me to count the number of instances of each specified type.

I can create a long-winded template which will go through each node and increment a counter every time it discovers a new type, but i was wondering if there was a neat way to do it that I am missing.

Cheers
Reply With Quote