XSL - Get attribute of previous element

Posted by Chris on Stack Overflow See other posts from Stack Overflow or by Chris
Published on 2010-06-16T13:47:19Z Indexed on 2010/06/16 13:52 UTC
Read the original article Hit count: 141

Filed under:
|
|

In the if block below I want to be also test whether @Timestamp is smaller than the previous Message's timestamp. How can I achieve this?

<xsl:for-each select="Message">
    <xsl:sort select="position()" data-type="number" order="descending"/>
    <xsl:variable name="newclass">
        <xsl:if test="@Timestamp + 60 &gt; $ctimestamp">new</xsl:if>
    </xsl:variable>

    <tr><td class="debugtime">
        <xsl:value-of select="@Time"/>
    </td><td class="{$newclass}">
        <xsl:value-of select="node()"/>
    </td></tr>
</xsl:for-each>

© Stack Overflow or respective owner

Related posts about Xml

Related posts about xslt