In particular use the :last-child selector, which is non-standard but supported by all major browsers.
O3CGTZFGRKSPLHSOIVYZOWWKF3YTAMIOMDZAMUTQL5R2JQXCK5BQC
3JCIP7EZEYCLFC3KGMZDE3DTVX4H4AMLXXBEKSX33BFFZASMYGZQC
4JPNFWRBFCFER74NDL3XZXNQ25YQCPD7E4XKYKF7VCWIESE56G4AC
J5UVLXOK6EDIL5I7VKWH4V2QDS4DPD7FHRK6XBWSXFRQS4JKXFZQC
YNHNVV3HFWQV53NOYXGVT3SNXDL5I7BMFGQRZ2ATUGUXPXXS74ZQC
BA46C5LNEQ57N52IJTCEXW4J74F33KKNYHYXE6ZJLQ5ARMCJPUHAC
GN3JXNQSF2TQARUPPZJQUP5P4WQRIELDSVQYTIUFJ5KJKO5HXXSQC
QU5QJUKCGDWQFDJ3QPGICY4NISXOCUNDXG62IQJNKEW64YCG3HMAC
$(".logTreeCollapseAll").click(function() {
$(".logTreeToggle", $(this).parent().siblings(".toplevel")).map(function() {
$(".tree-collapse-all").click(function() {
$(".tree-toggle", $(this).parent().siblings(".tree")).map(function() {
<!-- Is this the last line? If so, mark it as such so that it
can be rendered differently. -->
<xsl:variable name="class"><xsl:choose><xsl:when test="position() != last()">line</xsl:when><xsl:otherwise>lastline</xsl:otherwise></xsl:choose></xsl:variable>
<li class='{$class}'>
<span class='lineconn' />
<span class='linebody'>
<xsl:apply-templates select='.'/>
</span>
<li class='tree-line'>
<span class='tree-conn' />
<xsl:apply-templates select='.'/>