UofCRuss
01-06-2009, 10:51 AM
I have a quick question regarding XSL. I am currently working on a project that helps students schedule there university courses, the output (the scheduled courses) is provided in XML. What I want to do is take that XML and display it as a weekly schedule going from Monday to Sunday and 08:00 to 18:00.
My problem is I have 5 classes that could run anywhere from Monday to Sunday and from 08:00 to 18:00. How would I use XSL to display a weekly schedule? The only way I could think of doing it was to check if a class ran at 08:00 on monday if it did display the name, then check 08:30 on monday, 09:00 on monday...... 08:00 on sunday.... etc.
This method seem very long. Is there another way of doing this?
Here is the XML data that I get back from the scheduler (1 Class)
<course>
<faculty>ENEL</faculty>
<number>567</number>
<description>Cmos Vlsi Engineering </description>
<lecture>
<instructor>Karan Vir Inder Kaler</instructor>
<section>01</section>
<peoplesoft>18352</peoplesoft>
<days>
<monday>true</monday>
<tuesday>false</tuesday>
<wednesday>true</wednesday>
<thursday>false</thursday>
<friday>true</friday>
<saturday>false</saturday>
<sunday>false</sunday>
</days>
<stime>15:00</stime>
<etime>15:50</etime>
<location>ENA 227</location>
</lecture>
<tutorial>
<instructor>Karan Vir Inder Kaler</instructor>
<section>01</section>
<peoplesoft>18358</peoplesoft>
<days>
<monday>false</monday>
<tuesday>false</tuesday>
<wednesday>true</wednesday>
<thursday>false</thursday>
<friday>false</friday>
<saturday>false</saturday>
<sunday>false</sunday>
</days>
<stime>08:00</stime>
<etime>08:50</etime>
<location>ENA 227</location>
</tutorial>
<laboratory>
<instructor>Karan Vir Inder Kaler</instructor>
<section>01</section>
<peoplesoft>18354</peoplesoft>
<days>
<monday>false</monday>
<tuesday>false</tuesday>
<wednesday>true</wednesday>
<thursday>false</thursday>
<friday>false</friday>
<saturday>false</saturday>
<sunday>false</sunday>
</days>
<stime>09:00</stime>
<etime>11:50</etime>
<location>ICT 216</location>
</laboratory>
</course>
My problem is I have 5 classes that could run anywhere from Monday to Sunday and from 08:00 to 18:00. How would I use XSL to display a weekly schedule? The only way I could think of doing it was to check if a class ran at 08:00 on monday if it did display the name, then check 08:30 on monday, 09:00 on monday...... 08:00 on sunday.... etc.
This method seem very long. Is there another way of doing this?
Here is the XML data that I get back from the scheduler (1 Class)
<course>
<faculty>ENEL</faculty>
<number>567</number>
<description>Cmos Vlsi Engineering </description>
<lecture>
<instructor>Karan Vir Inder Kaler</instructor>
<section>01</section>
<peoplesoft>18352</peoplesoft>
<days>
<monday>true</monday>
<tuesday>false</tuesday>
<wednesday>true</wednesday>
<thursday>false</thursday>
<friday>true</friday>
<saturday>false</saturday>
<sunday>false</sunday>
</days>
<stime>15:00</stime>
<etime>15:50</etime>
<location>ENA 227</location>
</lecture>
<tutorial>
<instructor>Karan Vir Inder Kaler</instructor>
<section>01</section>
<peoplesoft>18358</peoplesoft>
<days>
<monday>false</monday>
<tuesday>false</tuesday>
<wednesday>true</wednesday>
<thursday>false</thursday>
<friday>false</friday>
<saturday>false</saturday>
<sunday>false</sunday>
</days>
<stime>08:00</stime>
<etime>08:50</etime>
<location>ENA 227</location>
</tutorial>
<laboratory>
<instructor>Karan Vir Inder Kaler</instructor>
<section>01</section>
<peoplesoft>18354</peoplesoft>
<days>
<monday>false</monday>
<tuesday>false</tuesday>
<wednesday>true</wednesday>
<thursday>false</thursday>
<friday>false</friday>
<saturday>false</saturday>
<sunday>false</sunday>
</days>
<stime>09:00</stime>
<etime>11:50</etime>
<location>ICT 216</location>
</laboratory>
</course>