xsl-list
[Top] [All Lists]

RE: xml to xml transformation

2003-05-15 23:20:29
Hi,

My problem is that I want to Sum the total of all the Batches 
belonging to each Entity(including its Sub-Entities). For 

  <xsl:template match="Entity">
    <xsl:copy>
      <xsl:apply-templates select="node()"/>
      <Sum>
        <xsl:value-of select="sum(descendant::TotalAmount)"/>
      </Sum>
    </xsl:copy>
  </xsl:template>
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

how chould I go about it. In a programming world, this would 
be achieved through recursive functions. How Would I do this in XSLt.

You can use recursive template calls in XSLT--though in this case you need not.

Cheers,

Jarno - Dulce Liquido: Psicosis


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



<Prev in Thread] Current Thread [Next in Thread>