xsl-list
[Top] [All Lists]

RE: [xsl] calendar generation

2010-05-11 18:34:59

Here's something to get you started:

One comment on this
   <xsl:for-each select="1 to 365">
     <xsl:variable name="days"
        select="xs:dayTimeDuration(concat('P',.,'D'))"/>
     <xsl:sequence select="$start-date + $days"/>
   </xsl:for-each>

I would probably write

<xsl:for-each select="1 to 365">
  <xs:sequence select="$start-date + .*$ONE_DAY"/>
</xsl:for-each>

with

<xsl:variable name="ONE_DAY" select="xs:dayTimeDuration('P1D')"/>

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay  


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>