Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] Problem with filtrate sum

From: j23 <duniaj@--.--.---.-->
To: xsl-list@-----.------------.---
Date: 10/1/2009 5:12:00 PM
Hello,
I have a problem, probably it is very easy but I'm beginner
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="22.xsl" type="text/xsl" ?>

<root-element>
	<Row NR="1">
		<Name>Andrew</Name>
		<Number>6.0</Number>
	</Row>
	
	<Row NR="2">
		<Name>Andrew</Name>
		<Number>0</Number>
	</Row>
	
	<Row NR="3">
		<Name>Joe</Name>
		<Number>1.600</Number>
	</Row>
	
	<Row NR="4">
		<Name>Joe</Name>
		<Number>1.000</Number>
	</Row>
	<Row NR="5">
		<Name>Andy</Name>
		<Number>4.003</Number>
	</Row>
</root-element>	

my xsl:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:exslt="http://exslt.org/common"
		version="1.0">
	
	<xsl:template match="/" >
		<html>
			<body>
	<xsl:apply-templates />
			</body>
		</html>
	</xsl:template>
	<xsl:output indent="yes"/>
	
	<xsl:template match="root-element">
		
		<table>
			<xsl:variable name="x">
				<xsl:for-each select="Row[position()>=1]">
					<d><xsl:value-of select="translate(Number,'.','')"/></d>
				</xsl:for-each>
			</xsl:variable>
			
			<td><xsl:value-of select="sum(exslt:node-set($x)/d) "/></td>
			
		</table>
	</xsl:template>
	
</xsl:stylesheet>

I would  like to sum number (without character '.'). It works.
Now I try sum  for one name, I make like this but it doesn't work
<xsl:value-of select="sum([Name = 'Joe']exslt:node-set($x)/d) "/>
How can I filtrate sum with using function translate, or key?

thank you for help
Regards
J23

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@l...>
--~--



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent