Format Date in XSL

Discussion in 'XML' started by Andrew, Dec 9, 2003.

  1. Andrew

    Andrew Guest

    I have 2 XSL stylesheets which both draw on data from Team Services.
    The same code is included in each stylesheet to format the date using
    VBScript:

    =================
    <msxsl:script language="VBScript" implements-prefix="user">
    Function GetDate(thepasseddate)
    GetDate=formatdatetime(left(thepasseddate,10),vbLongDate)
    End Function
    </msxsl:script>
    =================

    and displaying the result using:

    =================
    <xsl:value-of select="user:GetDate(string(tp_nDate))"/>
    =================

    THE PROBLEM:
    ============

    One of them works fine, the othr one I keep getting an error page on
    and I can't figure out why. I have looked at CDATA stuff and tried
    shifting the code around, but it has little or similar effect.

    ==========
    THE ERROR
    ==========

    An unexpected error occurred.
    Microsoft VBScript runtime error Type mismatch: 'formatdatetime' line
    = 5, col = 2 (line is offset from the start of the script block).
    Error returned from property or method call.
    -2147352567
    msxml3.dll

    ========
    THE PLEA
    ========

    Hopefully someone can help me, I am only just finding my feet with
    this stuff but this one has me stumped. I cannot see any major
    differences in the data that is being drawn upon in TS.

    TIA

    Andrew
    Andrew, Dec 9, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Candy
    Replies:
    2
    Views:
    1,149
    Janaka
    Feb 18, 2004
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,229
    Michael Borgwardt
    May 30, 2004
  3. Replies:
    1
    Views:
    3,588
    A. Bolmarcich
    May 27, 2005
  4. xsl date format

    , Jul 21, 2006, in forum: XML
    Replies:
    2
    Views:
    1,216
    Martin Honnen
    Jul 21, 2006
  5. Chu
    Replies:
    3
    Views:
    4,176
    Shawn
    Aug 15, 2006
Loading...

Share This Page