xslt current-dateTime() not returning millisecond info
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 8
- Joined: Wed May 07, 2008 4:43 pm
xslt current-dateTime() not returning millisecond info
i need time with millisecond info to be returned. i used current-dateTime() to get the current date and time. this function is not returning the millisecond info. i referred in the function spec site.. and saw that this function will return millisecond info. why does it didnt return in my case?
Thanks in advance
Thanks in advance
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: xslt current-dateTime() not returning millisecond info
Post by sorin_ristache »
Hello,
The function current-dateTime() returns the current time including milliseconds, for example: 2008-05-07T18:12:23.593+03:00 where .593 represents the milliseconds. If you want to extract only a fragment of the returned time you can apply the format-dateTime() function to the result of current-dateTime().
Regards,
Sorin
The function current-dateTime() returns the current time including milliseconds, for example: 2008-05-07T18:12:23.593+03:00 where .593 represents the milliseconds. If you want to extract only a fragment of the returned time you can apply the format-dateTime() function to the result of current-dateTime().
Regards,
Sorin
-
- Posts: 8
- Joined: Wed May 07, 2008 4:43 pm
Re: xslt current-dateTime() not returning millisecond info
Thanks for the reply. i used the same function which you have mentioned.
i am using xmlspy 2007. the following is my xslt.
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan" xmlns:func="http://exslt.org/functions" xmlns:ctvf="http://www.contivo.com/xslt/extensions" extension-element-prefixes="func ctvf" exclude-result-prefixes="xalan">
<xsl:template match="/">
<xsl:variable name="dateTime" select="current-dateTime()"/>
<xsl:value-of select="$dateTime"/>
</xsl:template>
</xsl:stylesheet>
but my output is : 2008-05-07T11:24:35-04:00
which is without the millisec info. why is it so?
i am using xmlspy 2007. the following is my xslt.
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan" xmlns:func="http://exslt.org/functions" xmlns:ctvf="http://www.contivo.com/xslt/extensions" extension-element-prefixes="func ctvf" exclude-result-prefixes="xalan">
<xsl:template match="/">
<xsl:variable name="dateTime" select="current-dateTime()"/>
<xsl:value-of select="$dateTime"/>
</xsl:template>
</xsl:stylesheet>
but my output is : 2008-05-07T11:24:35-04:00
which is without the millisec info. why is it so?
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: xslt current-dateTime() not returning millisecond info
Post by sorin_ristache »
That is what the XMLSpy processor returns. Use Saxon 9 for running the transformation if you need milliseconds in the result of the function. Oxygen comes with an embedded version of the Saxon 9 processor.
Regards,
Sorin
Regards,
Sorin
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service