Subject: RE: [xsl] Finding min and max From: "Andreas Schnabl" <Oandie@xxxxxxx> Date: Tue, 31 May 2005 14:48:32 +0200 (MEST) |
Hi there, I already read the the way how to find the min and max node of an element. The difference for my stylesheet is that my element consists of two values. I would need the smallest value of the number with the leading 35. So it has to be something with substring-before(.,' ') as I tried below, to get the first part of the element. The values look like this: <gml>3569875,45 5896534,23/>gml> <gml>3552365,56 583256975,56/>gml> I tried the version with the recursive template, but it didn't work out. My code looks like that: <xsl:template name="minimum_x"> <xsl:param name="nodes" /> <xsl:param name="min_temp" select="0"/> <xsl:choose> <xsl:when test="$nodes" > <xsl:variable name="min-so-far"> <xsl:call-template name="minimum_x"> <xsl:with-param name="nodes" select="$nodes[position() != 1]" /> <xsl:with-param name="min_temp" select="substring-before($nodes[1],' ')"/> </xsl:call-template> </xsl:variable> <xsl:choose> <xsl:when test="$min-so-far < ."> <xsl:value-of select="$min-so-far" /> </xsl:when> <xsl:otherwise> <xsl:value-of select="." /> </xsl:otherwise> </xsl:choose> </xsl:when> </xsl:choose> </xsl:template> any help will be appreciated andy -- Geschenkt: 3 Monate GMX ProMail gratis + 3 Ausgaben stern gratis ++ Jetzt anmelden & testen ++ http://www.gmx.net/de/go/promail ++
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] XPath Query Required, Andrew Welch | Thread | [xsl] xsl:number and conditional, Bruce D'Arcus |
RE: [xsl] XPath Query Required, Andrew Welch | Date | Re: [xsl] Q - Value of param doesn', Ahsan Ali |
Month |