Loading ...
Sorry, an error occurred while loading the content.

newbie: problem with using external templates

Expand Messages
  • justin_collum
    I m trying to format a date (8601 format) into a format that I like better. Found a great set of date formatting tools created by Jeni Tennison
    Message 1 of 1 , Oct 23, 2003
    • 0 Attachment
      I'm trying to format a date (8601 format) into a format that I like
      better. Found a great set of date formatting tools created by Jeni
      Tennison (http://sources.redhat.com/ml/xsl-list/2001-
      08/msg00858.html). Problem is that when I put them into an xsl like
      so:

      <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:date="http://exslt.org/dates-and-times"
      extension-element-prefixes="date">

      <xsl:import href="date.parse-date.template.xsl" />
      <xsl:import href="date.format-date.template.xsl" />

      <xsl:variable name="date">
      12-17-03
      </xsl:variable>
      <xsl:template match="/">
      <xsl:variable name="iso-8601-dateTime">
      <xsl:call-template name="date:parse-date">
      <xsl:with-param name="date-time" select="$date" />
      <xsl:with-param name="format" select="'MMM DD yyyy h:mma'" />
      </xsl:call-template>
      </xsl:variable>

      <xsl:call-template name="date:format-date">
      <xsl:with-param name="date-time" select="$iso-8601-dateTime" />
      <xsl:with-param name="format" select="'yyyy-M-DD h:mma'" />
      </xsl:call-template>

      </xsl:template>

      </xsl:stylesheet>

      This is exactly what Jenni suggested but whenever I try to use it I
      get an error about an undefined template in the date:parse-date
      section. Is there a chance that this is specific to a certain OS or
      something? I'm running WinXP and using XMLSpy for debugging...
    Your message has been successfully submitted and would be delivered to recipients shortly.