Loading ...
Sorry, an error occurred while loading the content.

Histograms and adaptative heigth problem ( rec. max. pb )

Expand Messages
  • emmanuel_corpet
    Hello everyone, I have difficulties to find the max heigth of my chart. my data structure is like this :
    Message 1 of 1 , Oct 11, 2005
    • 0 Attachment
      Hello everyone,

      I have difficulties to find the max heigth of my chart.

      my data structure is like this :

      <datas unit="p.">
      <colonne label="12/05">
      <bloc name="point1" value="5"/>
      <bloc name="point2" value="10"/>
      <bloc name="point3" value="15"/>
      </colonne>
      <!-- height : 30 -->
      <colonne label="13/05">
      <bloc name="point1" value="20"/>
      <bloc name="point2" value="40"/>
      <bloc name="point3" value="30"/>
      </colonne>
      <!-- height : 90 -->
      <colonne label="13/05">
      <bloc name="point1" value="20"/>
      <bloc name="point2" value="30"/>
      <bloc name="point3" value="30"/>
      </colonne>
      <!-- height : 80 -->
      </datas>

      What i want is to get a variable wich value would be 90
      I tried a recursive function but i don't know how to simulate a
      temporary variable.

      Thanks a lot for your help !

      --------------------------------------------------

      my recursive function (doesn't work because once the value is
      assignated ... value can't be re assignated .. i think )

      <xsl:template name="max_rec">
      <xsl:param name="list"/>
      <xsl:choose>
      <xsl:when test="$list">
      <xsl:variable name="recursive_result">
      <xsl:call-template name="max_rec">
      <xsl:with-param name="list" select="$list[position() > 1]"/>
      </xsl:call-template>
      </xsl:variable>
      <xsl:if test="$recursive_result < sum($list[1]/bloc/@value)">
      <xsl:value-of select="sum($list[1]/bloc/@value)"/>
      </xsl:if>
      </xsl:when>
      <xsl:otherwise>
      <xsl:value-of select="0"/>
      </xsl:otherwise>
      </xsl:choose>
      </xsl:template>
    Your message has been successfully submitted and would be delivered to recipients shortly.