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:
  #1  
Old May 27th, 2004, 04:19 PM
kfenstad kfenstad is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 5 kfenstad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
count() question

hello,

i have an XML structure like the following:

Code:
<columns>
  <column>
     <label num="1"/>
  </column>
  <column>
     <label num="3"/>
     <label num="2"/>
     <label num="1"/>
  </column>
  <column>
     <label num="2"/>
     <label num="1"/>
  </column>
</columns>


i need to get the maximum number of labels that fall under a column. so, i could either get a count or get the num attribute, it doesn't matter, as long as it returns the number 3. is there a way to do this?

thanks.

Reply With Quote
  #2  
Old May 28th, 2004, 08:33 AM
kfenstad kfenstad is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 5 kfenstad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i figured it out, but will post the answer here for anyone else with the same question:

<xsl:variable name="maxLabels" select="columns/column/label_row[not(../../column/label_row/@num > @num)]/@num"/>

thanks

Reply With Quote
  #3  
Old June 1st, 2004, 05:03 AM
nihaarika2002 nihaarika2002 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 49 nihaarika2002 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
i also got same doubt

hi
i also got same doubt
but unfortunately solution you gave not working to me
dont know what mistake i m doing..
can u give me full code pls..
if u could..
thank u
with regards
niha

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > count() question


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 4 hosted by Hostway
Stay green...Green IT