|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Group and display the min value [for each item]
I'm trying to get the min value from an xml file. This code works but sometimes doesnt take the just min value and most of all not sort the results in a ascending way. Could you help me ? Regards. you could see The xml file in www.lastminutesud.it/test/last_mad_lgw.xlm <xsl:key name="OutwardList" match="Outward" use="SegmentList/Segment/Operator/Name"/> <xsl:template match="/"> <xsl:for-each select="//Outward[generate-id(.)=generate-id(key('OutwardList',SegmentList/S egment/Operator/Name))]"> <xsl:sort select="Price/Amount" order="ascending" data-type="number"/> <xsl:variable name="ok_op" select="SegmentList/Segment/Operator/Name" /> <xsl:variable name="min"> <xsl:for-each select="//Outward[SegmentList/Segment/Operator/Name=$ok_op]/Price/Amount/tex t()"> <xsl:sort select="." order="ascending" data-type="number"/> <xsl:if test="position() = 1"> <xsl:value-of select="."/> </xsl:if> </xsl:for-each> </xsl:variable> <xsl:value-of select="$min"/> </xsl:for-each> </xsl:template>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Cast Your Vote
We need your help – Vote for DataDirect XML Products!
Winners and finalists announced at SOA World Conference in November. Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|







