Discussion:
Convert milliseconds into date
xslt xslfo
2006-04-12 19:01:57 UTC
Permalink
Hi:

I have a date that is expressed in milliseconds. How do I convert it into a
readable date format? I have tried using EXSLT date and time, but it does not
seem to work.

Any suggestions?

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
Michael Kay
2006-04-12 19:09:53 UTC
Permalink
Post by xslt xslfo
I have a date that is expressed in milliseconds. How do I
convert it into a
readable date format? I have tried using EXSLT date and time,
but it does not
seem to work.
In 2.0,

<xsl:variable name="DATE_ORIGIN" select="xs:date('1970-01-01')"
as="xs:date"/>
(or whatever your baseline is)
<xsl:variable name="MILLISECOND" select="xdt:dayTimeDuration('PT0.001S')"
as="xdt:dayTimeDuration"/>

then (say):

<xsl:value-of select="format-date($DATE_ORIGIN + ($date * $MILLISECOND),
'[Do] [MNn] [Y]')"/>

In 1.0 there's no standard way of doing it. You need extensions, for example
the EXSLT extensions. If these didn't work for you, you need to explain what
you did and in what way it failed.

Michael Kay
http://www.saxonica.com/





--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
xslt xslfo
2006-04-12 20:33:49 UTC
Permalink
Hi:

Thank you for your response. I read thru some archive and tried
implementing this:
date:add('1970-01-01T00:00:00Z',
date:duration($milliseconds div 1000))

I used the exslt namespace and imported date.xsl into my stylesheet.
Am I missing something here?
Post by xslt xslfo
I have a date that is expressed in milliseconds. How do I
convert it into a
readable date format? I have tried using EXSLT date and time,
but it does not
seem to work.
In 2.0,

as="xs:date"/>
(or whatever your baseline is)
as="xdt:dayTimeDuration"/>

then (say):



In 1.0 there's no standard way of doing it. You need extensions, for example
the EXSLT extensions. If these didn't work for you, you need to explain what
you did and in what way it failed.

Michael Kay
http://www.saxonica.com/





--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
--~--

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
Michael Kay
2006-04-12 20:59:34 UTC
Permalink
Post by xslt xslfo
Thank you for your response. I read thru some archive and tried
date:add('1970-01-01T00:00:00Z',
date:duration($milliseconds div 1000))
I used the exslt namespace and imported date.xsl into my stylesheet.
Am I missing something here?
There are two ways EXSLT functionality can be provided: as extension
functions or as named templates. You have imported the templates and then
tried to call the extension functions.

Check whether the extension functions are available for your chosen XSLT
processor; if not, use the templates (which you invoke using
xsl:call-template)

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
xslt xslfo
2006-04-13 15:18:11 UTC
Permalink
Hello:

I am using version 1.0. Can you point me to an example to implement
these templates using EXSLT extensions?

Thank you
Post by xslt xslfo
Thank you for your response. I read thru some archive and tried
date:add('1970-01-01T00:00:00Z',
date:duration($milliseconds div 1000))
I used the exslt namespace and imported date.xsl into my stylesheet.
Am I missing something here?
There are two ways EXSLT functionality can be provided: as extension
functions or as named templates. You have imported the templates and then
tried to call the extension functions.

Check whether the extension functions are available for your chosen XSLT
processor; if not, use the templates (which you invoke using
xsl:call-template)

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
--~--

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
Jon Gorman
2006-04-13 15:30:30 UTC
Permalink
Post by xslt xslfo
I am using version 1.0.
You need to know the processor. You're just stating the version of
the stylesheet. That's like responding to someone asking what browser
you use and you say "HTML 4.01". You need to look for examples with
the processor you're running (xsltproc, saxon, xalan...

Can you point me to an example to implement
Post by xslt xslfo
these templates using EXSLT extensions?
Not without knowing the processor.

Interesting gmail addy.

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
xslt xslfo
2006-04-13 15:42:24 UTC
Permalink
Hello:

RenderX is used for the processing. It uses SAXON as the xslt engine.
I have searched high and dry for a solution to this. I would
appreciate if you could point me in the right direction for a
solution.
Post by xslt xslfo
I am using version 1.0.
You need to know the processor. You're just stating the version of
the stylesheet. That's like responding to someone asking what browser
you use and you say "HTML 4.01". You need to look for examples with
the processor you're running (xsltproc, saxon, xalan...

Can you point me to an example to implement
Post by xslt xslfo
these templates using EXSLT extensions?
Not without knowing the processor.

Interesting gmail addy.

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
--~--

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
Michael Kay
2006-04-13 15:55:19 UTC
Permalink
Saxon (both 6.5.5 and 8.7.1) support the "core" EXSLT date functions but not
the "other" (non-core) functions listed at
http://www.exslt.org/date/index.html. The core functions don't include any
date arithmetic.

I suggest you use Saxon 8.7.1 and use the XPath 2.0 date arithmetic
functions and operators as the simplest solution to your problem.

Michael Kay
http://www.saxonica.com/
-----Original Message-----
Sent: 13 April 2006 16:42
Subject: Re: [xsl] Convert milliseconds into date
RenderX is used for the processing. It uses SAXON as the xslt engine.
I have searched high and dry for a solution to this. I would
appreciate if you could point me in the right direction for a
solution.
Post by xslt xslfo
I am using version 1.0.
You need to know the processor. You're just stating the version of
the stylesheet. That's like responding to someone asking
what browser
you use and you say "HTML 4.01". You need to look for
examples with
the processor you're running (xsltproc, saxon, xalan...
Can you point me to an example to implement
Post by xslt xslfo
these templates using EXSLT extensions?
Not without knowing the processor.
Interesting gmail addy.
--~------------------------------------------------------------------
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
xslt xslfo
2006-04-13 16:26:11 UTC
Permalink
I used the following expression that I read in one of the archives:

<xsl:value-of select="xs:dateTime('1970-01-01T00:00:00') + $in *
xs:dayTimeDuration('PT0.001S')"/>

The name space used is xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"

The result I get is NaN.

Saxon (both 6.5.5 and 8.7.1) support the "core" EXSLT date functions
but not
the "other" (non-core) functions listed at
http://www.exslt.org/date/index.html. The core functions don't include
any
date arithmetic.

I suggest you use Saxon 8.7.1 and use the XPath 2.0 date arithmetic
functions and operators as the simplest solution to your problem.

Michael Kay
http://www.saxonica.com/
-----Original Message-----
Sent: 13 April 2006 16:42
Subject: Re: [xsl] Convert milliseconds into date
RenderX is used for the processing. It uses SAXON as the xslt engine.
I have searched high and dry for a solution to this. I would
appreciate if you could point me in the right direction for a
solution.
Post by xslt xslfo
I am using version 1.0.
You need to know the processor. You're just stating the version
of
the stylesheet. That's like responding to someone asking
what browser
you use and you say "HTML 4.01". You need to look for
examples with
the processor you're running (xsltproc, saxon, xalan...
Can you point me to an example to implement
Post by xslt xslfo
these templates using EXSLT extensions?
Not without knowing the processor.
Interesting gmail addy.
--~------------------------------------------------------------------
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
Michael Kay
2006-04-13 16:44:16 UTC
Permalink
Post by xslt xslfo
<xsl:value-of select="xs:dateTime('1970-01-01T00:00:00') + $in *
xs:dayTimeDuration('PT0.001S')"/>
The name space used is
xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"
The result I get is NaN.
I think this is what you would get if

(a) the stylesheet specifies version="1.0"

and

(b) the value of $in is untypedAtomic.

Since you haven't shown us the xsl:stylesheet element or the declaration of
$in, this is just a hypothesis.

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
xslt xslfo
2006-04-13 16:51:35 UTC
Permalink
This is what I am using;

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes"
xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xsl:value-of select="xs:dateTime('1970-01-01T00:00:00') + $in *
xs:dayTimeDuration('PT0.001S')"/>

The $in is date in "long" format which is passed as a paramter to the
XSL:FO. For testing, I have hardcoded the value to 1143230642199.

Does this help?

--------------------------------------------------------------------------------------

I think this is what you would get if

(a) the stylesheet specifies version="1.0"

and

(b) the value of $in is untypedAtomic.

Since you haven't shown us the xsl:stylesheet element or the
declaration of
$in, this is just a hypothesis.

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--


Delete Reply Forward Spam Move...
Previous | Next | Back to Messages

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
Michael Kay
2006-04-13 18:10:21 UTC
Permalink
You've confirmed that version="1.0", and I suspect despite what you say that
$in is untypedAtomic rather than xs:long. In the calculation, try wrapping
it as xs:integer($in).

Michael Kay
http://www.saxonica.com/
-----Original Message-----
Sent: 13 April 2006 17:52
Subject: RE: [xsl] Convert milliseconds into date
This is what I am using;
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:value-of select="xs:dateTime('1970-01-01T00:00:00') + $in *
xs:dayTimeDuration('PT0.001S')"/>
The $in is date in "long" format which is passed as a paramter to the
XSL:FO. For testing, I have hardcoded the value to 1143230642199.
Does this help?
--------------------------------------------------------------
------------------------
I think this is what you would get if
(a) the stylesheet specifies version="1.0"
and
(b) the value of $in is untypedAtomic.
Since you haven't shown us the xsl:stylesheet element or the
declaration of
$in, this is just a hypothesis.
Michael Kay
http://www.saxonica.com/
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
--~--
Delete Reply Forward Spam Move...
Previous | Next | Back to Messages
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
xslt xslfo
2006-04-13 18:24:18 UTC
Permalink
The $in which is in milliseconds is an external parameter declared on
the stylesheet using <xsl:param>
---------------------------------------------------------------------------------------------------------------------

You've confirmed that version="1.0", and I suspect despite what you say
that
$in is untypedAtomic rather than xs:long. In the calculation, try
wrapping
it as xs:integer($in).

Michael Kay
http://www.saxonica.com/
-----Original Message-----
Sent: 13 April 2006 17:52
Subject: RE: [xsl] Convert milliseconds into date
This is what I am using;
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:value-of select="xs:dateTime('1970-01-01T00:00:00') + $in *
xs:dayTimeDuration('PT0.001S')"/>
The $in is date in "long" format which is passed as a paramter to the
XSL:FO. For testing, I have hardcoded the value to 1143230642199.
Does this help?
--------------------------------------------------------------
------------------------
I think this is what you would get if
(a) the stylesheet specifies version="1.0"
and
(b) the value of $in is untypedAtomic.
Since you haven't shown us the xsl:stylesheet element or the
declaration of
$in, this is just a hypothesis.
Michael Kay
http://www.saxonica.com/
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
--~--
Delete Reply Forward Spam Move...
Previous | Next | Back to Messages
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
Michael Kay
2006-04-13 22:41:21 UTC
Permalink
Post by xslt xslfo
The $in which is in milliseconds is an external parameter declared on
the stylesheet using <xsl:param>
The actual type of $in depends on whether you have declared the type in the
xsl:param declaration (I suspect you haven't, or you would have told us) and
on the object supplied in the invocation of the stylesheet. If you are
running from the command line, then the value will be untypedAtomic. If you
are running from a Java application, then it depends on what you supply in
the call: if you supply a Long, the value will be an xs:integer; if you
supply a String, it will be an xs:string.

Michael Kay
http://www.saxonica.com/
Post by xslt xslfo
--------------------------------------------------------------
-------------------------------------------------------
You've confirmed that version="1.0", and I suspect despite
what you say
that
$in is untypedAtomic rather than xs:long. In the calculation, try
wrapping
it as xs:integer($in).
Michael Kay
http://www.saxonica.com/
-----Original Message-----
Sent: 13 April 2006 17:52
Subject: RE: [xsl] Convert milliseconds into date
This is what I am using;
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:value-of select="xs:dateTime('1970-01-01T00:00:00') + $in *
xs:dayTimeDuration('PT0.001S')"/>
The $in is date in "long" format which is passed as a
paramter to the
XSL:FO. For testing, I have hardcoded the value to 1143230642199.
Does this help?
--------------------------------------------------------------
------------------------
I think this is what you would get if
(a) the stylesheet specifies version="1.0"
and
(b) the value of $in is untypedAtomic.
Since you haven't shown us the xsl:stylesheet element or the
declaration of
$in, this is just a hypothesis.
Michael Kay
http://www.saxonica.com/
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
--~--
Delete Reply Forward Spam Move...
Previous | Next | Back to Messages
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
xslt xslfo
2006-04-14 14:11:17 UTC
Permalink
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"/>
The value I get when I try to print this is 1143228551205 (just as an example).

Is there any way to use javascripts on XSL:FO. I know it can be done
on XSLT. Can it be done on XSL:FO? Otherwise, can anyone please help
me get a solution to this?

Thanks in advance for all your help.

----------------------------------------------------------------------------------------------------------------
Post by xslt xslfo
The $in which is in milliseconds is an external parameter declared on
the stylesheet using
The actual type of $in depends on whether you have declared the type in the
xsl:param declaration (I suspect you haven't, or you would have told us) and
on the object supplied in the invocation of the stylesheet. If you are
running from the command line, then the value will be untypedAtomic. If you
are running from a Java application, then it depends on what you supply in
the call: if you supply a Long, the value will be an xs:integer; if you
supply a String, it will be an xs:string.

Michael Kay
http://www.saxonica.com/
Post by xslt xslfo
--------------------------------------------------------------
-------------------------------------------------------
You've confirmed that version="1.0", and I suspect despite
what you say
that
$in is untypedAtomic rather than xs:long. In the calculation, try
wrapping
it as xs:integer($in).
Michael Kay
http://www.saxonica.com/
-----Original Message-----
Sent: 13 April 2006 17:52
Subject: RE: [xsl] Convert milliseconds into date
This is what I am using;
Post by xslt xslfo
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
The $in is date in "long" format which is passed as a
paramter to the
XSL:FO. For testing, I have hardcoded the value to 1143230642199.
Does this help?
--------------------------------------------------------------
------------------------
I think this is what you would get if
(a) the stylesheet specifies version="1.0"
and
(b) the value of $in is untypedAtomic.
Since you haven't shown us the xsl:stylesheet element or the
declaration of
$in, this is just a hypothesis.
Michael Kay
http://www.saxonica.com/
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
--~--
Delete Reply Forward Spam Move...
Previous | Next | Back to Messages
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
--~--

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
Jon Gorman
2006-04-14 15:22:53 UTC
Permalink
Post by xslt xslfo
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).
Post by xslt xslfo
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)
Post by xslt xslfo
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?
Post by xslt xslfo
Can it be done on XSL:FO?
XSL-FO is a format for visual display of information, so no, not likely.
Post by xslt xslfo
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

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--
Florent Georges
2006-04-14 15:40:25 UTC
Permalink
Post by Jon Gorman
1) Use the latest Saxon release.
2) Convert the stylesheet to XSLT 2.0
3) Convert the value to the type xs:integer.
If the goal is only to compute a single value, there is no need to
migrate the whole scripts to 2.0. Just create a 2.0 script to compute
the value and include (or import) it in the plain old 1.0 scripts.

I think you can even use 2.0 functionalities in 1.0 scripts, when
using 2.0 processor. But I don't know the exact details here.

Regards,

--drkm
























___________________________________________________________________________
Faites de Yahoo! votre page d'accueil sur le web pour retrouver directement vos services préférés : vérifiez vos nouveaux mails, lancez vos recherches et suivez l'actualité en temps réel.
Rendez-vous sur http://fr.yahoo.com/set

--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-***@lists.mulberrytech.com>
--~--

Continue reading on narkive:
Loading...