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 August 10th, 2008, 12:44 AM
lockmac lockmac is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 2 lockmac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 9 sec
Reputation Power: 0
Xslt- selecting elements that exist more than once

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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Xslt- selecting elements that exist more than once


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-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT