Hi guys. I am just asking for some help with my xslt.
I have an XML file which with a structure like below (havnt included the whole file)
Code:
<units xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="studentschema.xsd">
<unit>
<unitCode>FIT2028</unitCode>
<unitLeader>Janet Fraser</unitLeader>
<class tutorialNo="t1">
<tutor>Janet Fraser</tutor>
<tutor>Christine Clemence</tutor>
<timetable>
<day>Wednesday</day>
<time>14:00:00</time>
<room>G3.18</room>
</timetable>
<studentMarks>
<student id="s12233441">
Now their are multiple unit elements and each has the same structure. Now i need to create a xslt that will list all student elements who are part of both the unit shown above (with unitCode FIT2028) and another unit (with a value of FIT3043).
I also have to show the average for each of these units.
Now I really dont know how to do this.
I know how to compare values but i dont know how to compare them in this context.
Can somebody please help me? Am desperate!
So far.. i have this code that was given to me and it seems to get the results of the students i want, but i dont konw how to get the average from both units, i can only get the average for the first unit it selects....
Code:
<xsl:apply-templates select="/units/unit/class/studentMarks/student[ancestor::unit/unitCode = 'FIT2028']
[@id= /units/unit/class/studentMarks/student[ancestor::unit/unitCode = 'FIT3043']/@id]"/>
Many thanks in advance