date.xslt 808 B

12345678910111213141516171819202122
  1. <xsl:stylesheet
  2. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. exclude-result-prefixes=""
  4. xmlns:date="http://exslt.org/dates-and-times"
  5. extension-element-prefixes="date"
  6. version="1.0">
  7. <xsl:output method="text"/>
  8. <xsl:template match="/">
  9. <xsl:variable name="pat" select="'~_date-'"/>
  10. <xsl:variable name="tom_href" select="//*[@class='multidays_next']//a[contains(@href, $pat)]/@href"/>
  11. <xsl:variable name="tomorrow" select="substring(substring-after($tom_href, $pat), 1, 10)"/>
  12. <!-- http://exslt.org/date/functions/add/ -->
  13. <xsl:variable name="today" select="date:add($tomorrow, '-P1D')"/>
  14. _ <xsl:value-of select="$today"/>
  15. _ <xsl:value-of select="$tomorrow"/>
  16. _ <xsl:value-of select="date:day-abbreviation($tomorrow)"/>
  17. </xsl:template>
  18. </xsl:stylesheet>