|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: local extremums
Hi again,
I think this has a slight better chance of success :) The most important thing is to change value-of() with number() as the first gives the string value, the last it's numerical value (better for finding extrema). If there is something wrong with this code, I would like to hear it myself. <xsl:template match="Range[number(@Cnt)>number(./previous-sibling/@Cnt) and number(@Cnt)<value-of(./next-sibling/@Cnt)]"> <xsl:call-template name="IsLocalMaximum"/> </xsl:template> <xsl:template match="Range[not(number(@Cnt)>number(./previous-sibling/@Cnt) and number(@Cnt)<value-of(./next-sibling/@Cnt))]"> <xsl:choose> </xsl:when test="position()=1 and number(@Cnt)>number(./next-sibling/@Cnt)]><xsl:call-template name="IsLocalMaximum"/><xsl:when> </xsl:when test="position()=last() and number(@Cnt)<number(./previous-sibling/@Cnt)]><xsl:call-template name="IsLocalMaximum"/><xsl:when> <xsl:otherwise><xsl:call-template name="IsNotLocalMaximum"/></xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="IsLocalMaximum"> <!-- Do your stuff here --> </xsl:template> <xsl:template name="IsNotLocalMaximum"> <!-- Do your other stuff here --> </xsl:template> Ragulf _________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! 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
|

Cart








