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 July 12th, 2004, 10:09 AM
mr.euro mr.euro is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 21 mr.euro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 h 18 m 8 sec
Reputation Power: 0
complicated transformation, logic needed

what I want to do is loop through each team, then pull out a number that represents how many "weeks" they have a greater "result" attribute than the other teams. The problem is; I can not find a way to pull out this number.. most of it because I can not change the value of a variable.

The wanted result for the xml below would be:

team 1818: weeks won = 1 (week number 4)
team 1919: weeks won = 2 (week number 2 and 3)
team 2020: weeks won = 1 (week number 1)


Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="prim_year.xslt"?>

<year>

	<team teamID="1818">
		<manager>john adams</manager>
		<month monthID ="september">
			<week number="1" result="5"/>
			<week number="2" result="2"/>
			<week number="3" result="5"/>
			<week number="4" result="2"/>
		</month>
	</team>
	
	<team teamID="1919">
		<manager>jorge camra</manager>
		<month monthID ="september">
			<week number="1" result="4"/>
			<week number="2" result="3"/>
			<week number="3" result="6"/>
			<week number="4" result="1"/>
		</month>
	</team>
	
	<team teamID="2020">
		<manager>jamie loydd</manager>
		<month monthID ="september">
			<week number="1" result="6"/>
			<week number="2" result="2"/>
			<week number="3" result="1"/>
			<week number="4" result="1"/>
		</month>
	</team>
	
</year>


I have spent quite some time trying to do this and would appriciate any little hint on how to solve this.

Reply With Quote
  #2  
Old July 13th, 2004, 02:52 AM
Miska's Avatar
Miska Miska is offline
Madden Maniac
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2001
Location: Finland
Posts: 519 Miska User rank is Lance Corporal (50 - 100 Reputation Level)Miska User rank is Lance Corporal (50 - 100 Reputation Level)Miska User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 3 h 47 m 50 sec
Reputation Power: 8
OK,

this shouldn't be "too" hard. Here's just a few pointers for you. If you think about your XML then you prob see that you need 2 for-each loops (1 for result fetching and 1 for printing the results). param fields can easily hold your results as you can change them. Take a look at call-template for result fetching...

If these don't help you out enough, just post and I'll tell you more...

Reply With Quote
  #3  
Old July 16th, 2004, 09:40 AM
mr.euro mr.euro is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 21 mr.euro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 h 18 m 8 sec
Reputation Power: 0
many thanks for the hints
I have given it a few more hours but I can not get it to work.
can you tell me somthing more about the param fields?
maybe an example..

cheers

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > complicated transformation, logic needed


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

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT