Subject:calling templates based on order of node sets Author:todd jackson Date:26 May 2009 08:05 PM Originally Posted: 26 May 2009 07:07 PM
I'm having problems ordering a list of occurrences, for start & end dates, for tertiary courses, based on which campus they are run at.
I can get all the occurences dates for each course listed if I replace the for-each block in the XSLT (see below) and use "<xsl:apply-templates select="COURSEDEFINITION/COURSEOCCURRENCES/COURSEOCCURRENCE"/>" in its place. But it doesn't work when I use the for-each block, and want to order all the dates for courses running under their respective campus?
Subject:calling templates based on order of node sets Author:James Durning Date:27 May 2009 01:27 PM
List of all campuses:
Get all unique instances:
Campus: <xsl:value-of select="."/>
Now, inside this for-loop, find all the COURSEDEFINITIONS that take place on this campus. Use current() to get the value of the current node.
<xsl:for-each select="/COURSES/COURSEDEFINITION[COURSEOCCURENCE/CAMPUS = current()]">
Output the relevant date information here.
Also in the future, please post the end tags at the end of your xml, so your code sample is well-formed xml.