XSL - How to tell if element is last in series
Posted
by Chris
on Stack Overflow
See other posts from Stack Overflow
or by Chris
Published on 2010-05-12T09:55:10Z
Indexed on
2010/05/12
10:04 UTC
Read the original article
Hit count: 167
I have an XSL template that is called (below). What I would like to do is be able to tell if I am the last Unit
being called.
<xsl:template match="Unit[@DeviceType = 'Node']">
<!-- Am I the last Unit in this section of xml? -->
<div class="unitchild">
Node: #<xsl:value-of select="@id"/>
</div>
</xsl:template>
Example XML
<Unit DeviceType="QueueMonitor" Master="1" Status="alive" id="7">
<arbitarytags />
<Unit DeviceType="Node" Master="0" Status="alive" id="8"/>
<Unit DeviceType="Node" Master="0" Status="alive" id="88"/>
</Unit>
© Stack Overflow or respective owner