Re: [xsl] Convert milliseconds into date

Subject: Re: [xsl] Convert milliseconds into date
From: "Jon Gorman" <jonathan.gorman@xxxxxxxxx>
Date: Fri, 14 Apr 2006 10:22:53 -0500
On 4/14/06, xslt xslfo <xslt.techie@xxxxxxxxx> wrote:
> Hello:
>
> I am sorry I do not quite understand. Let me try to be explain what is
> happening on my side. There is an external application that is
> supplying this parameter called "longdate" to the style sheet and that
> is a complete black box to me. All the information I have is that this
> parameter called longdate is in long format.  So on XSL:fo I just say
> <xsl:param name="longdate"/>
This isn't XSL-FO, it's XSLT (both of which are called XSL).

> The value I get when I try to print this is 1143228551205 (just as an
example).
>

Let me summarize from what I've seen Michael suggest:

1) Use the latest Saxon release.
2) Convert the stylesheet to XSLT 2.0
3) Convert the value to the type xs:integer.  This is an area I've
haven't explored yet with XSLT, but a quick looks at the Michael
already suggestions it looks like you might be able to do
xs:integer($i) (http://www.w3.org/TR/xpath20/#FunctionsAndOperators).
I believe you can also do <xsl:param name="foo" as="xs:integer"> as
mentioned in the docs.  (http://www.w3.org/TR/xslt20/#built-in-types)

> Is there any way to use javascripts on XSL:FO. I know it can be done
> on XSLT.

Where did you hear this?  You can't use JavaScript in XSLT.  You can
produce it, but that's another matter entirely.  Or do you mean have a
JavaScript engine that calls an XSLT processor?


> Can it be done on XSL:FO?
XSL-FO is a format for visual display of information, so no, not likely.

> Otherwise, can anyone please help
> me get a solution to this?

What's wrong with Michael Kay's suggestions?  (He didn't necessarily
do a lot of hand holding, but he did give you the changes you needed
to do several times).

Jon Gorman

Current Thread