This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: scripting


i would recc using the extensive date time stuff at www.exslt.org or
http://xsltsl.sourceforge.net

chow, jim fuller

( another std response...hehe )

----- Original Message -----
From: "Aleksei Valikov" <valikov@fzi.de>
To: <xsl-list@lists.mulberrytech.com>
Sent: Wednesday, August 15, 2001 2:07 PM
Subject: Re: [xsl] scripting


> Hi.
>
> > I'm converting an xml document to a prism document
> > using a stylesheet.  One of the elements in the XML
> > document is date, which is given in "MM DD
> > YYYY H:MM" format (example: "Jul 10 1999 9:10AM").  I
> > want the date to be formated w/ the year first (ex:
> > "1999-7-10 9:10AM" ).  Can I change my XSL stylesheet
> > to do this?  Do I need to use bean scripting/java
> > scripting?  Is this compatible w/ JAXP?
>
> I think that for now pretty clean and portable solution will be a named
> template with a parameter.
>
> You define it:
>
> <xsl:template name="datetoprism">
>   <xsl:param name="date"/>
>   <xsl:value-of select="substring($date,8,11)"/>
>   <!-- and so on -->
>  </xsl:template>
>
> Call it:
>
> <xsl:call-template name="datetoprism">
>   <xsl:with-param name="date" select="'Jul 10 1999 9:10AM'"/>
> </xsl:call-template>
>
> The only question left is how to write the conversion routine.
> See substring functions. You will probably also need to convert month from
> textual representation into a number.
>
> Bye.
> /lexi
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]