|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
||||
|
||||
|
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... ![]() |
|
#3
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > complicated transformation, logic needed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|