C
Claudio Jolowicz
How do you convert time from seconds since 1 Jan 1970 to a local time
string in an XSLT stylesheet?
XSLT doesn't seem to offer a function for this, so I tried to call a
CGI script in the stylesheet:
<xsl:value-of select="document('strftime.cgi?{@time}')/time"/>
The script strftime.cgi converts its argument to local time and prints
it out as an XML document:
echo "Content-type: text/xml"
echo
echo "<time>$(./strftime $QUERY_STRING)</time>"
But the xsl:value-of produces no output, although the script works
when called directly from a browser.
What apparently happens is that the "{@time}" in the stylesheet does
not get evaluated. Instead, the script is passed the literal string
"{@time}".
Any suggestions?
Claudio
string in an XSLT stylesheet?
XSLT doesn't seem to offer a function for this, so I tried to call a
CGI script in the stylesheet:
<xsl:value-of select="document('strftime.cgi?{@time}')/time"/>
The script strftime.cgi converts its argument to local time and prints
it out as an XML document:
echo "Content-type: text/xml"
echo
echo "<time>$(./strftime $QUERY_STRING)</time>"
But the xsl:value-of produces no output, although the script works
when called directly from a browser.
What apparently happens is that the "{@time}" in the stylesheet does
not get evaluated. Instead, the script is passed the literal string
"{@time}".
Any suggestions?
Claudio