[xsl] using date and duration

Subject: [xsl] using date and duration
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Sat, 4 Dec 2004 20:02:34 -0500
I'm coming back to a schema and stylesheets I was working on earlier for course syllabi.

The biggest hassle once the syllabus instance is done is recoding it each term to adjust for the dates. I'm wondering if anyone has any suggestions on how to exploit the new xpath 2.0 date and duration operators to make this less painful.

Here's an example of where the date-related code is at now:

      <outline readings="yes">
	<section>
	  <title>Citizenship and the City</title>
	  <topic>
	    <date type="month-day">1/13,15</date>
	    <description>Who is the Public?</description>
	  </topic>
	  <topic>
	    <date type="month-day">1/20,22</date>
	    <description>Public Space and the City</description>
	    <readings>
	      <reading refid="Staeheli1996">Staeheli 1996</reading>
	    </readings>
	  </topic>
	</section>

So, the above is a section of an outline for the course, in this case divided by week.

I also have a structure to handle events like exams and holidays:

	  <event type="holiday">
	    <date type="month-day">2/17</date>
	    <description>Exchange Day</description>
	  </event>

My thought is that perhaps instead I could have something like ...

<dates>
  <start-date>2004-01-10</start-date>
  <holiday>2004-02-17</holiday>
</dates>

.... and then just have the XSLT processor calculate the correct dates. Any suggestions on how best to handle this?

Bruce

Current Thread