xsl-list
[Top] [All Lists]

RE: [xsl] Multi condition sum [Correction]

2008-12-12 06:11:24

sum(book[column[(_at_)name='status']='available']/column[(_at_)name='quantity'])

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: peter verhaar [mailto:peter(_dot_)verhaar1(_at_)gmail(_dot_)com] 
Sent: 12 December 2008 10:22
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Multi condition sum [Correction]

Hello,

Sorry my last message was send to early.

I have one question. assume this snippet:

<books>
 <book>
   <column name="quantity">50</column>
   <column name="status">available</column>  </book>  <book>
   <column name="quantity">10</column>
   <column name="status">available</column>  </book>  <book>
   <column name="quantity">3</column>
   <column name="status">lost</column>
 </book>
</books>


Now I want to add all Quantity IF Status = "Available".

All sum is this: sum(books/book[(_at_)name="quantity"])

but how to add the Status = "Available" condition???

Thank you

--~------------------------------------------------------------------
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(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
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(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>