xsl-list
[Top] [All Lists]

Re: Grouping by key

2004-11-04 20:26:08
On Thu, 04 Nov 2004 23:00:25 +0100, Geert Josten
<geert(_dot_)josten(_at_)daidalos(_dot_)nl> wrote:
Yes, in XPath 1.0 only the first node in a node-set is used when one
value is expected -- there's no distinction b/n functions and
operators in this respect.
.

Oh, but that is not true. See 3.4 of XPath Rec 1.0...

By "one value" I meant an "atomic value" (not a sequence). 

Conversion to boolean being the notable exception:

       boolean(non-empty-node-set) = true()

The above holds always, even when the first node of this node-set has
a value "" or "0".

Still, even in this case it is the presence or absence of the first
node, that solely determines the value.

And there are some functions that accept a single node as an argument
-- when passed a node-set they use its first node.

Such functions are: generate-id(), name(), local-name(),
namespace-uri(), etc. ...

And, of course, there are functions that require a node-set as
argument -- count() comes to mind immediately, but also sum().



Cheers,
Dimitre.


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