This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Convert the sign of a number
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Convert the sign of a number
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Thu, 5 Jul 2001 12:26:29 +0100
- References: <NEBBJGCDKMLHOAAONGKDEECACDAA.daniel.newman@bis-web.net>
- Reply-To: xsl-list at lists dot mulberrytech dot com
> function convertSign(balance)
Isn't that a rather complicated way of multiplying by -1?
It would be easier to have offered help if you'd have supplied a small
test file with more than one item (to have something to add) and without
all the superflous stuff like TradeHolderIdentifier etc, but
If I understand the question I think you want to generate a table of
running totals which is something like
<xsl:template match="RetrieveTransactionHistory2RSResponse">
<table>
<tr><td></td><td><xsl:value-of select="CurrentBalance"/></td></tr>
<xsl:apply-templates select="Items/Item[1]">
<xsl:with-param name="x" select="CurrentBalance"/>
</xsl:apply-templates>
</table>
</xsl:template>
<xsl:template match="Item">
<xsl:param name="x" select="0"/>
<tr>
<td>
<xsl:value-of select="MoneyTrade"> <!-- guessing this is the
element to sum, you didn't say -->
</td>
<td>
<xsl:value-of select="$x+MoneyTrade"/>
</td>
</tr>
<xsl:apply-templates select="following-sibling::Item[1]">
<xsl:with-param name="x" "$x+MoneyTrade"/>
</xsl:apply-templates>
</xsl:templates>
David
(untested)
> The information transmitted is intended only for the person or entity to
> which it is addressed and may contain confidential and/or privileged
> material. Any review, retransmission, dissemination or other use of, or
You do realise you posted that to a mail server which will archive the
text for public access on the web?
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list