xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] xml to xml transformation


Subject: RE: [xsl] xml to xml transformation
From: Jarno.Elovirta@xxxxxxxxx
Date: Fri, 16 May 2003 09:20:29 +0300

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



Current Thread
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor