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

Re: scripting

Subject: Re: scripting
From: "Aleksei Valikov" <valikov@xxxxxx>
Date: Wed, 15 Aug 2001 15:07:30 +0200
islaam wed
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


Current Thread
  • scripting
    • Samina Islam - Wed, 15 Aug 2001 08:59:34 -0400 (EDT)
      • Aleksei Valikov - Wed, 15 Aug 2001 09:15:32 -0400 (EDT) <=
        • cutlass - Wed, 15 Aug 2001 11:16:22 -0400 (EDT)
      • Jeni Tennison - Wed, 15 Aug 2001 12:34:51 -0400 (EDT)

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.