jhartridge
Programmer
Hello,
I have a program that stores the results of various tests on a piece of eqiptment in XML format.
A basic test result is of the form :-
A PumpLog consists of many such entries.
The <Description> can be ony one of about a dozen different test descriptions. Several <PumpLogItems> can have the same <Description> for repeated tests.
The PumpLogItems are all in Date and Time order (as they are added to the end when the test is done).
I need to be able to display just the LAST <PumpLogItem> for each <Description> in the list of <PumpLogItem>s to show the latest test results for all the tests done.
I can display the FIRST <PumpLogItem> for each <Description> by using :-
but how do I get the LAST <PumpLogItem> ??
Sorry for such a long question. Thanks for any pointers.
John
I have a program that stores the results of various tests on a piece of eqiptment in XML format.
A basic test result is of the form :-
Code:
<PumpLogItem>
<Date>05/02/04</Date>
<Time>09:42:30</Time>
<Operator>jh</Operator>
<Result>
<Description>Dry Side Pressure Calibration</Description>
<Detail>Pass</Detail>
<Data>08256,45760,99,589,585,1220,1216</Data>
</Result>
</PumpLogItem>
The <Description> can be ony one of about a dozen different test descriptions. Several <PumpLogItems> can have the same <Description> for repeated tests.
The PumpLogItems are all in Date and Time order (as they are added to the end when the test is done).
I need to be able to display just the LAST <PumpLogItem> for each <Description> in the list of <PumpLogItem>s to show the latest test results for all the tests done.
I can display the FIRST <PumpLogItem> for each <Description> by using :-
Code:
<xsl:for-each select="PumpLogItem">
<xsl:if test="not(Result/Description=preceding:Result/Description)">
output PumpLog item elements
</xsl:if>
</xsl:for-each>
Sorry for such a long question. Thanks for any pointers.
John