[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: date formatting function

Subject: Re: date formatting function
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Tue, 21 Sep 2004 08:00:24 -0400
xsl date
On Sep 21, 2004, at 4:48 AM, Michael Kay wrote:

You seem to be asking how to divide the code you need to write between two templates/functions, when both options you present are perfectly viable.

I guess I wanted to know if I was headed down the right road, and you seem to be saying "maybe."


I guess my question, given what I want to do, is how should I construct the function; as a single function -- let's call it bib:format-month-day -- that when called takes any YYYY/YYYY-MM/YYYY-MM-DD string and returns the formatted date (with parameter for whether months are rendered as full or abbreviated)?

That's where I was headed. But if that's sensible, I'm not sure how to actually code it; .e.g. what goes inside the "when" below:

     <xsl:when test="$date castable as xs:gYearMonth">
       ...
     </xsl:when>

Or, more specifically, how do I take the statement "xs:date(concat($date, '-01'))" and then use format-date on it?

Bruce

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.