Subject: Re: [xsl] difference between an integer and current-dateTime() From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Sat, 28 Mar 2020 11:42:22 -0000 |
I've tried following XSLT stylesheet upto now, based on your suggestions,B xmlns:xs="http://www.w3.org/2001/XMLSchema"
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
B B B B B B B B B B B B
-B B B B B B B B B B B B B exclude-result-prefixes="xs" B B B B B B B B B B B B B version="3.0">
B B <xsl:output method="text"/>
B B <xsl:param name="secsSinceEpoch" as="xs:integer"/>
B B <xsl:template match="/"> B B B B <xsl:variable name="epochDateTime" select="xs:dateTime('1970-01-01T00:00:00Z') +
B B B B B xs:dayTimeDuration('PT' || $secsSinceEpoch || 'S')"
B B B B B as="xs:dateTime"/> B B B B <xsl:variable name="diffDTduration" select="current-dateTime()
$epochDateTime" as="xs:dayTimeDuration"/> B B B B <xs:value-of select="$diffDTduration"/> B B </xsl:template>
</xsl:stylesheet>
When I invoke above stylesheet, as follows (using Saxon 10),
java -classpath saxon-he-10.0.jar net.sf.saxon.Transform -s:trf1.xsl -xsl:trf1.xsl secsSinceEpoch=1585039138
I get nothing into the output (i.e, <xs:value-of select="$diffDTduration"/> doesn't print anything). Any thoughts, how can I proceed further?
But there looks to be a valid value within the variable,B 'epochDateTime'.
let $epochDateTime := xs:dateTime('1970-01-01T00:00:00Z') + xs:dayTimeDuration('PT' || 1585039138 || 'S') return current-dateTime() - $epochDateTime
I am currently not sure why your code using those expressions in XSLT doesn't output anything, I will try to investigate and let you know.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] difference between an int, Mukul Gandhi gandhi. | Thread | Re: [xsl] difference between an int, Michael Kay mike@xxx |
Re: [xsl] difference between an int, Dimitre Novatchev dn | Date | Re: [xsl] difference between an int, Michael Kay mike@xxx |
Month |