i am trying to calculate the ram ussage of my Tasks( named quantum in the ressource tags) so far i am using the code below but in the last part the ram of the children is only displayed spereatly, does someone have any idea on how to summand them together? and help would be appreciated
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Ram Usage Overview</h2>
<table border="1">
<tr>
<th>Task</th>
<th>Parent</th>
<th>Path</th>
<th>Ram(self)</th>
<th>Ram(Children)</th>
</tr>
<xsl:for-each select="//start">
<tr>
<td>
<xsl:value-of select="@name"/>
</td>
<td>
<xsl:value-of select="ancestor::start[1]/@name"/>
</td>
<td>
<xsl:for-each select="ancestor-or-self::start">
<xsl:value-of select="@name"/>
<xsl:if test="position() != last()">
<xsl:text> -> </xsl:text>
</xsl:if>
</xsl:for-each>
</td>
<td>
<xsl:value-of select="resource/@quantum"/>
</td>
<td>
<xsl:for-each select="config/start">
<xsl:value-of select="substring-before(resource/@quantum,'M')"/>
<!--this is where i want get the sum-->
</xsl:for-each>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
XML
<config name="init">
<start name="A">
<resource name="RAM" quantum="2024M"/>
<config>
<start name="B">
<resource name="RAM" quantum="1024M"/>
</start>
<start name="C">
<resource name="RAM" quantum="1024M"/>
<config>
<start name="D">
<resource name="RAM" quantum="512M"/>
</start>
<start name="E">
<resource name="RAM" quantum="512M"/>
<config>
<start name="F">
<resource name="RAM" quantum="256M"/>
<config>
<start name="H">
<resource name="RAM" quantum="128M"/>
</start>
<start name="I">
<resource name="RAM" quantum="128M"/>
</start>
</config>
</start>
<start name="G">
<resource name="RAM" quantum="256M"/>
</start>
</config>
</start>
</config>
</start>
</config>
</start>
</config>
i am very sorry for any formatting that may got screwed up