I'm trying to display a university courses timetable using XSLT. My DTS looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT timetable (day,day,day,day,day,day,day)>
<!ELEMENT day (session)*>
<!ELEMENT session (begin,end,(course?))>
<!ELEMENT course (#PCDATA)>
<!ELEMENT begin (#PCDATA)>
<!ELEMENT end (#PCDATA)>
I want to display all the courses in a Day/Hour table that looks something like this (excuse the horrible design):
Trouble is, I want to do a for each
clause, but just on regular numbers, not on parts of the xml. Is that possible with XSLT? For example, it would probably look something like this:
/* for each time = 8..17, do: */
<xsl:for-each select="timetable/day">
<xsl:value-of select="session[[begin</*time*/ or begin=/*time*/]/course" />
</xsl:for-each>