Search
Monday, January 05, 2009 ..:: Web Design Blog ::.. Register  Login
 Archive Minimize

 Print   

 Search Blogs Minimize

 Print   

 Web Design Blog Minimize
Apr 11

Written by: Joel Taylor
4/11/2008

The XSLT Standart Library can be found at http://xsltsl.sourceforge.net/.  I recently used version 1.2.1 for an airport flight information data system to format dates and times flights were arriving.  The code was simple to use and well documented.  It is distributed as a zip file and in order to use it you just need to include a directory with the library in it.  In order to keep it simple I named the directory with the version.

To include the functions you would like in your xsl file you need to include an import function.  The statements below show an import from the xsltsl-1.2.1 folder which was at the same level as the xsl.  The date-time.xsl includes the functions.

<xsl:import href="xsltsl-1.2.1/date-time.xsl"/>


To call the format-date-time function you would add code like this to the xsl.  The @actual is the field from your xml data that you are going to format.

<xsl:call-template name="dt:format-date-time">
        <xsl:with-param name="xsd-date-time" select="@actual"/>
        <xsl:with-param name="format" select="'%i:%M %Q'"/>
</xsl:call-template>

 

 

Copyright ©2008 Joel Taylor

Tags:

Your name:
Title:
Comment:
Add Comment    Cancel  

  

Copyright 2002 - 2007 by Taylor Consulting, LLC   Terms Of Use  Privacy Statement