|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Working with xs:date and xs:gYearMonth
>>>>> "Michael" == Michael Kay <mhk@xxxxxxxxx> writes:
>> Well, rather than use a baseline at all, since I am only
>> interested in the previous and following months in the 21st
>> century for my application, I came up with the following safe
>> (if somewhat verbose) solution:
Michael> Some comments inline:
>>
>>
>> <xsl:variable name="today" select="current-date ()"
>> as="xs:date"/> <xsl:param name="date" select="$today"
>> as="xs:date"/>
Michael> Why two variables with the same value? You could just
Michael> declare the param, and give it a default value of
Michael> current-date().
I need the today variable for other purposes elsewhere in the
stylesheet.
Michael> Your coding style of doing the work with a sequence of
Michael> local variables inside an outer xsl:variable is
Michael> interesting. I wouldn't have thought of doing it this
Michael> way, but I can't fault it.
I did it that way just so I could be absolutely clear in my mind what I was
doing.
But I think I'll take on board your suggestions, as the stylesheet
will be much shorter then.
Thanks.
--
Colin Paul Adams
Preston Lancashire
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








