[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Finding min and max

Subject: RE: Finding min and max
From: "Andreas Schnabl" <Oandie@xxxxxxx>
Date: Tue, 31 May 2005 14:48:32 +0200 (MEST)
xsl min max
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 &lt; .">
            <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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.