XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old August 11th, 2003, 03:28 PM
shagg99 shagg99 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 2 shagg99 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post XSLT Get Distinct Node Count

I have an XML document that looks like this:

<NewDataSet>
<Table>
<Column1ID>1</Column1ID>
<Column1>Movies</Column1>
<Column2ID>10</Column2ID>
<Column2>Mr. Deeds</Column2>
<Column3ID>20</Column3ID>
<Column3>DVD</Column3>
</Table>
<Table>
<Column1ID>1</Column1ID>
<Column1>Movies</Column1>
<Column2ID>12</Column2ID>
<Column2>Terminator 2</Column2>
<Column3ID>20</Column3ID>
<Column3>DVD</Column3>
</Table>
<Table>
<Column1ID>2</Column1ID>
<Column1>Music</Column1>
<Column2ID>13</Column2ID>
<Column2>Metallica</Column2>
<Column3ID>22</Column3ID>
<Column3>CD</Column3>
</Table>
</NewDataSet>

I am trying to build a Treeview out of this xml using XSL. What I want to be able to do is get a distinct count of Column1ID. For the XML provided I would have a total count of 2 (Movies & Music).

Does anyone know how I can accomplish this?

TIA!

Shaggy

Reply With Quote
  #2  
Old August 12th, 2003, 02:07 AM
Wizard2003's Avatar
Wizard2003 Wizard2003 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 206 Wizard2003 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 h 29 m 24 sec
Reputation Power: 6
There is a function provided by exslt.
The function is called set:distinct.
The only parameter is a node-set.
The return value of the function is a node-set. It selects a node N if there is no node in NS that has the same string value as N, and that precedes N in document order.

Reply With Quote
  #3  
Old August 12th, 2003, 09:35 AM
shagg99 shagg99 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 2 shagg99 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I've never used exslt before.

How would I use this?

<xsl:call-template name="set:distinct">
<xsl:with-param name="nodes" select="//NewDataSet/Table/ColumnID1"/>
</xsl:call-template>

How do I get the count?

Seth

Last edited by shagg99 : August 12th, 2003 at 10:00 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XSLT Get Distinct Node Count


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway