Re: [xsl] Grouping by key

Subject: Re: [xsl] Grouping by key
From: Dimtre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 5 Nov 2004 14:26:08 +1100
On Thu, 04 Nov 2004 23:00:25 +0100, Geert Josten
<geert.josten@xxxxxxxxxxx> 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.

Current Thread