[xsl] Accumulator needed

Subject: [xsl] Accumulator needed
From: Karim Barkati <barkati@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 05 Jul 2001 17:46:23 +0200

I'm trying to generated an SVG file from a MusicXML file, using a XSLT
I need to compute my x_offset depending on the duration of the previous
In other words, I need an accumulator.
I tried to use an xsl:variable, but I learned it's not updateable...
Any suggestion is welcome. :-)

Karim Barkati

<!-- Draw notes. -->
<xsl:for-each select="note">
 <xsl:apply-templates select=".">
 <xsl:with-param name="x_offset" select="$LEFT_MARGIN + 10">
 <xsl:with-param name="y_offset" select="$TOP_MARGIN + $HEADER_SIZE +
(($measure_number - 1) * ($SYSTEM_SPACING + (4 *


  <!-- Draw a quarter note. -->
  <xsl:template match="note">
    <xsl:if test="type='quarter'">
      <xsl:element name="g">
 <xsl:attribute name="transform">
   <xsl:value-of select="$x_offset"></xsl:value-of>
   <xsl:value-of select="$y_offset"></xsl:value-of>

 <xsl:element name="use">
   <xsl:attribute name="xlink:href"

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread