<generator name='Google Calendar - Today&apos;s Events' xmlns='http://www.mozilla.org/microsummaries/0.1'>
  <template>
    <transform version='1.0' xmlns='http://www.w3.org/1999/XSL/Transform'>
      <output method='text'/>
      <template match='/'>
        <choose>

          <!-- If there are some events taking place today, iterate over them,
             - generating a comma-separated list with event times and titles.
             - Not all "cell-today" cells actually contain events, so we have
             - to check each cell before attempting to display the event in it.
             -->
          <when test='.//td[contains(@class, &apos;cell-today&apos;)]//span[@class=&apos;event-summary&apos;]'>
            <for-each select='.//td[contains(@class, &apos;cell-today&apos;)]'>
              <if test='.//span[@class=&apos;event-summary&apos;]'>
                <!-- We have a today cell containing an event. Process it. -->

                <!-- If this isn't the first today cell we've processed, put
                   - a comma before the event.  Note: if the first today cell
                   - is ever empty, this will put a comma before the first
                   - event, which will be ugly.
                   -->
                <if test='not(position()=1)'><text>, </text></if>

                <!-- Some events are all-day and don't occur at a specific time,
                   - so only include the time if the event has one.
                   -->
                <if test='.//span[@class=&apos;event-time&apos;]'>
                  <value-of select='.//span[@class=&apos;event-time&apos;]'/>
                  <text>: </text>
                </if>

                <!-- Include the summary of the event. -->
                <value-of select='.//span[@class=&apos;event-summary&apos;]'/>

              </if>
            </for-each>
          </when>

          <!-- No events are happening today; display a message to that effect. -->
          <otherwise>
            <text>no events today</text>
          </otherwise>

        </choose>
      </template>
    </transform>
  </template>

  <pages>
    <include>^http://www\.google\.com/calendar/embed\?src=</include>
  </pages>

  <!-- Update four times a day. -->
  <update interval='360'/>
</generator>
