Subject: Re: Boolean XPath Expression and sum
From: Francis Norton <francis@xxxxxxxxxxx>
Date: Wed, 09 May 2001 23:36:16 +0100
|
John Wang wrote:
>
>
> <?xml version="1.0"?>
> <abuncha>
> <thing>1</thing>
> <thing>2</thing>
> <thing>3</thing>
> <thing>5</thing>
> <sum>11</sum>
> </abuncha>
>
> my question is: Where does the 11 come from?
>
Aha. Try ...
<count>
<xsl:value-of select="count(//thing[.!='N/A'])"/>
</count>
... for the value you *do* want.
The origin of the 11? Consider the difference between sum() and count()
...
Francis.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|