I am looking to have xslt grab every occurance of a field, in this case //field and then find the largest value held and output that.. would something like the below work? I have used something similair before but i am a little unsure on sort select'"value"
<xsl:choose>
<xsl:when test="count(//field1) > 0">
<xsl:for-each select="//field1">
<xsl:sort select="value" order="descending" />
<xsl:if test="position() = 1">
<xsl:value-of select="."/>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
the xml will be in a format something like below
<1>
<2>
<field>125</field>
</2>
</1>
<1>
<2>
<field>10</field>
</2>
</1>
<1>
<2>
<field>0</field>
</2>
</1>
(Not my choice of format for the XML, but it is what i have been dumped with to work with... in msot cases this field appears 28 times, but i always need the highest value.