Per Jessen wrote:

> <xsl:template match="email">
> 
>         <xsl:variable name="a" select="tx:strftime('%s',@received)"/>
>         <xsl:variable name="b" select="$a - 0"/>
> 
>         <k1 a="{$a}" a1="{$a - 0}" b="{$b}"><xsl:value-of select="$a -
>         0"/></k1>&nl;
> 
> </xsl:template>

A minor follow-up - if I change the template above to:

<xsl:template match="email">

        <xsl:variable name="a" select="tx:strftime('%s',@received) + 0"/>
        <xsl:variable name="b" select="$a"/>

        <k1 a="{$a}" a1="{$a - 0}" b="{$b}" b1="{$a - 0}"><xsl:value-of 
select="$a - 0"/></k1>&nl;

</xsl:template>


the result now becomes:

<?xml version="1.0" encoding="UTF-8"?>
<k1 a="1078242930" a1="1078242930" b="1078242930" 
b1="1078242930">1078242930</k1>
<k1 a="1078242930" a1="1078242930" b="1078242930" 
b1="1078242930">1078242930</k1>

I.e. the 2nd <email> element in the input XML appears to have been 
ignored/overriden??? 

If anyone fancies a look at the strftime() function source, it is available 
here:
http://jessen.ch/strftime

/Per

Reply via email to