Was having a devil of a time figuring out how to get the max date out of a node. This post enlightened me to the usage of XSL.
With XSLT 2.0 it is as easy as taking the min and max e.g.
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xsd"
version="2.0">
<xsl:template match="/">
<xsl:variable name="dates" as="xsd:dateTime*"
select="dsQueryResponse/Rows/Row/@StartDate/xsd:dateTime(.)"/>
<xsl:text>Minimum date: </xsl:text>
<xsl:value-of select="min($dates)"/>
<xsl:text>; maximum date: </xsl:text>
<xsl:value-of select="max($dates)"/>
</xsl:template>
</xsl:stylesheet>
You can run XSLT 2.0 in the COM world (e.g. JScript/VBScript, VB(A))
with AltovaXML tools http://www.altova.com/altovaxml.html and in the
.NET world with Saxon 9 (http://saxon.sourceforge.net/).
Sample dataset:
<dsQueryResponse>
<Rows>
<Row ProjectName="Elvis" StartDate="2009-10-01T04:00:00Z"
TargetDate="2009-12-21T04:00:00Z" Overall_x0020_Status="On Track"
_x0025__x0020_Complete=".8" />
<Row ProjectName="Dolly" StartDate="2009-09-11T04:00:00Z"
TargetDate="2009-12-01T04:00:00Z" Overall_x0020_Status="On Track"
_x0025__x0020_Complete=".66" />
<Row ProjectName="CCR" StartDate="2009-09-21T04:00:00Z"
TargetDate="2009-11-21T04:00:00Z" Overall_x0020_Status="Manageable
Issues" _x0025__x0020_Complete=".90" />
<Row ProjectName="Stones" StartDate="2009-09-15T04:00:00Z"
TargetDate="2009-12-28T04:00:00Z" Overall_x0020_Status="Project
Concern" _x0025__x0020_Complete=".50" />
</Rows>
</dsQueryResponse>