[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: <xsl:choose> and normalization of timestamp
Hi, trying to normalize timestamp while generating atom feed from docbook. Some timestamps in my document include time (not only date), other don’t. So, I have created this construct to normalize them. <xsl:variable name="datestr"><xsl:value-of select="d:info/d:date"/></xsl:variable> <xsl:message><xsl:value-of select="d:info/d:date"/></xsl:message> <xsl:variable name="datevalue"><xsl:choose><xsl:when test="contains('d:info/d:date','T')"><xsl:value-of select="$datestr"/></xsl:when> <xsl:otherwise><xsl:value-of select="concat($datestr,'T00:00:00')"/></xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:message>datevalue=<xsl:value-of select="$datevalue"/></xsl:message> However, it doesn't seem to work: [matej@viklef duchnik]$ xsltproc -o duchnik.atom atom.xsl duchnik.tdb 2008-07-05 datevalue=2008-07-05T00:00:00 2007-02-20T09:25+01:00 datevalue=2007-02-20T09:25+01:00T00:00:00 2006-02-18 datevalue=2006-02-18T00:00:00 2006-02-03 datevalue=2006-02-03T00:00:00 [matej@viklef duchnik]$ The value which originally already had a time value, is added another one. What I do wrong? Thanks for any help, Matěj
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]