|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Boolean XPath Expression and sum
Michael Kay wrote: > > > I need to sum up the all the values of things where their > > value is not equal > > to N/A, and am having a bit of trouble. > > XML might look like > > <abuncha> > > <thing>1</thing> > > <thing>2</thing> > > <thing>3</thing> > > <thing>5</thing> > > <thing>N/A</thing> > > </abuncha> > > sum(//thing[.!='N/A']) > Given that sum() just gives up as soon as it hits a non-number, you might want to consider sum(//thing[string(number(.)) != 'NaN']) Francis. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








