Re: How to pass parameter to VBScript in XSL?
James Fuller <[email protected]>
| Newsgroups | gmane.text.xml.xslt.extensions |
|---|---|
| Organization | Webcomposite |
| Message-ID | <[email protected]> |
Sudarshan Zawar wrote:
> Hi,
>
> I am translating one xml into another using stylesheet.
> My input xml has the tag
> <DueDateTime>06/30/2005 23:59:00</DueDateTime>
>
> Now in output xml, i have to deduct one day from this date.
> In the stylesheet i have written the following script like this.
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:msxsl="urn:schemas-microsoft-com:xslt"
> xmlns:vbs="urn:schemas-sqlxml-org:vbs"
> version="1.0">
> <xsl:output method="xml" omit-xml-declaration="yes"/>
> <msxsl:script language="vb-script" implements-prefix="vbs">
> <![CDATA[
> Function fnDate(DueDateTime)
> fndate = cstr(DATEADD("d",-1,DueDateTime))
> End Function
> ]]>
> </msxsl:script>
>
> Now i am calling the above script in the following trasnformation.
> <Start>
> <xsl:value-of disable-output-escaping="yes"
> select="vbs:fnDate(@DueDateTime)"/>
> </Start>
>
> But i its giving the error.
>
> If i directly pass the value as written below, it works.
> <Start>
> <xsl:value-of disable-output-escaping="yes"
> select="vbs:fnDate('05/05/2005')"/>
> </Start>
>
> Can you please help me regrding this? I want to pass the node value of
> DueDateTime in the function. I think there is something wrong with the
> parameter passing.
>
as far as I can tell, this has nothing to do with EXSLT? though u can
achieve what u want to do using EXSLT, check out
http://www.exslt.org/date/index.html
gl, Jim Fuller