[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: sum() applied to a product

Subject: Re: sum() applied to a product
From: Mukul Gandhi <mukul_gandhi@xxxxxxxxx>
Date: Tue, 29 Jun 2004 20:51:46 -0700 (PDT)
xpath sum
Hi Brian,
 Please try -

<?xml version="1.0"?> 
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
 
<xsl:output method="text" /> 

<xsl:template match="/a">
   <xsl:value-of select="(b[1]/c * b[1]/d) + (b[2]/c *
b[2]/d)" />
</xsl:template>
 
</xsl:stylesheet>

Regards,
Mukul

--- Brian Chrisman <brian.chrisman@xxxxxx> wrote:
> Uggg... I had some sloppy cut-paste issue in my last
> post... this is what it should have been, with a
> real subject line.  Sorry...
> 
> -----------------------
> Okay.. I told someone I could do this in a simple
> xpath expression
> 
> <?xml version="1.0"?>
> <a>
>   <b>
>     <c>2</c>
>     <d>4</d>
>   </b>
>   <b>
>     <c>3</c>
>     <d>6</d>
>   </b>
> </a>
> 
> Where the xpath was to return (2*4) + (3*6) = 26
> I made several attempts with xpath's sum() function
> (using 1.0) and 
> couldn't get it.
> I couldn't even come up with an expression that I
> thought might work.. 
> even though I tried several which I was certain
> would fail (which did).
> 
> Any ideas?



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.